The bending of light as it passes from one medium to another is called refraction. The angle and wavelength at which the light enters a substance and the density of that substance determine how much the light is refracted.

The bending occurs because light travels more slowly in a denser medium.

Refraction can be seen when looking into a bowl of water.

Air has a refractive index of about 1.0003, and water has a refractive index of about 1.3333. If a person looks at a straight object, such as a pencil or straw, which is placed at a slant, partially in the water, the object appears to bend at the water's surface. This is due to the bending of light rays as they move from the water to the air. Once the rays reach the eye, the eye traces them back as straight lines (lines of sight).

More Info: en.wikipedia.org