You can predict the angles among bound atoms through the theory of valence shell electron pair repulsion, or VSEPR. The "steric number" -- the total of other atoms and lone electron pairs bound to a central atom -- determines the geometry of a molecule. Lone electron pairs reside in the outer, or valance, shell of an atom, and aren't shared with other atoms. VSEPR is not a calculation, but rather a logical series of decisions based upon steric number. Only hydrogen has a steric number of one, and the H2 molecule has a linear shape.
An electron "orbits" an atom in a characteristic shape determined by the most likely places to find the electron at any time. Electrons repel each other because they all have negative charges, so orbitals tend to give each electron the maximum possible amount of distance from its neighbors. When a valence electron forms a covalent bond with another atom, the orbital changes in a process called hybridization. VSEPR predicts bond angles based upon hybridized orbitals, but is not accurate when applied to certain metallic compounds, gaseous salts and oxides.
The simplest hybrid orbital is sp, corresponding to a steric number of two. The bond angle is linear, or 180 degrees, when the atom has no lone electron pairs. An example is carbon dioxide. Conversely, a nitrogen molecule has one lone electron pair, giving it a linear shape but an unhybridized orbital and therefore no bond angle.
A steric number of three leads to the formation of sp2 orbitals. The bond angles depend on the number of lone electron pairs. For example, boron trichloride has no lone pairs, a trigonal planar shape and bond angles of 120 degrees. The trioxygen molecule O3 has one lone pair, forming a bent shape with bond angles of 118 degrees. On the other hand, O2 has two lone pairs and a linear shape.
An atom with a steric number of four can have from zero to three lone electron pairs within an sp3 hybridized orbital. Methane, which has no lone pairs, forms a tetrahedron with 109.5-degree bond angles. Ammonia has one lone pair, creating bond angles of 107.5 degrees and a trigonal pyramidal shape. Water, with two lone pairs of electrons, has a bent shape with 104.5-degree bond angles. Fluorine molecules have three lone pairs and a linear geometry.
Higher Steric Numbers
Higher steric numbers lead to more complex geometries and different bond angles. In addition to VSEPR, complicated theories such as molecular force fields and quantum theory also predict bond angles.