Wave refraction is the process that occurs when waves interact with the sea bed to slow the velocity of propagation as a function of wave length and period. As the waves slow down in shoaling water, the crests tend to realign at a decreasing angle to the depth contours. Varying depths along a wave crest cause the crest to travel at different phase speeds, with those parts of the wave in deeper water moving faster than those in shallow water. This process continues while the depth decreases, and reverses if it increases again, but the wave leaving the shoal area may have changed direction considerably. Rays—lines normal to wave crests between which a fixed amount of energy flux is contained—converge on local shallows and shoals. Therefore, the wave energy between rays is concentrated as they converge, with a resulting increase in wave height.