Different materials have different densities. Light waves may change direction at the boundary between two transparent materials. Refraction is the change in direction of a wave at such a boundary.
It is important to be able to draw ray diagrams to show the refraction of a wave at a boundary.
Refraction can cause optical illusions as the light waves appear to come from a different position to their actual source.
The density of a material affects the speed that a wave will be transmitted through it. In general, the denser the transparent material, the more slowly light travels through it.
Glass is denser than air, so a light ray passing from air into glass slows down. If the ray meets the boundary at an angle to the normal, it bends towards the normal.
The reverse is also true. A light ray speeds up as it passes from glass into air, and bends away from the normal.
wave speed = frequency × wavelength
So if a wave slows down, its wavelength will decrease. The effect of this can be shown using wave front diagrams, like the one below. The diagram shows that, as the wave travels into a denser medium, eg water, it slows down and the wavelength decreases. Although the wave slows down, its frequency remains the same, due to the fact that its wavelength is shorter.
In this diagram, the right hand side of the incoming wave slows down before the left hand side does. This causes the wave to change direction.