Light changes speed, so it changes direction
Light does not travel at one speed everywhere. It moves fastest through a vacuum, slower through air, slower still through water, and slower again through glass. When a ray crosses from one material into another at an angle, the change of speed bends the ray — an effect called refraction.
The picture is like a car driving from tarmac onto sand at an angle: the wheel that hits the sand first slows first, and the car slews around. Light does the same at every boundary, bending toward the perpendicular when it slows down and away from it when it speeds up. Only rays arriving exactly head-on pass through unbent.
Lenses: bending with intent
A lens is refraction shaped on purpose. A convex lens — thicker in the middle — bends incoming rays inward so they meet at a focus; a concave lens — thinner in the middle — spreads them apart. Cameras, microscopes, telescopes and projectors are all arrangements of these two tricks.
Spectacles use lenses to fix the eye's own focusing errors. In short sight, the eye bends light too strongly and images focus in front of the retina; a concave lens spreads the rays slightly so the eye's lens lands them exactly on the retina. Long sight needs the opposite help, from a convex lens.
Bent light fooling your eyes
Your brain assumes light has travelled straight, so refraction plays tricks. A straw in a glass of water looks bent and broken at the surface, because light from the underwater part changes direction on its way to you and your brain traces it back along the wrong line.
A swimming pool is shallower than it looks, for the same reason — a fact lifeguards and spear-fishers must correct for. On a hot road, air heated near the surface bends light from the sky down to your eyes, and the shimmering 'puddle' of a mirage is really a picture of the sky, delivered by bent light.

