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.
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 by the same angle.
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 wave travels into a denser medium, such as water, it slows down and 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 nearest to the water side of the incoming wave slows down before the furthest side does. This causes the wave to change direction.