Here's a summary of the Wikipedia explanation:
The oxygen atom in each water molecule attracts electrons more strongly than the hydrogen atoms, so the hydrogens have a slight positive charge. This allows water to form "hydrogen bonds" in which the positive hydrogens are attracted to the negative oxygen atoms of other molecules.
Each hydrogen can form a hydrogen bond with another water molecule and each oxygen can bond with two hydrogen atoms, so altogether one water molecule can have up to 4 hydrogen bonds with other water molecules. In an ice crystal there is a lattice of water atoms held together with these "hydrogen bonds".
The hydrogen bonds have a certain length that holds the water molecules in position at a certain distance apart from each other. As the ice is heated and melts, fewer hydrogen bonds can form, the lattice structure breaks, and the water molecules are allowed to come slightly closer together. This causes liquid water to have a lower density.
That was what i was taught too, except that liquid water has a higher density, not lower, compared with ice.
Phooey. It is not the case with other molecules.
yitbos