Molecular Geometry

Read this page. Can you explain why carbon dioxide is a linear molecule, while water is bent? Lone pairs of electrons from the Lewis structures become very important here.