Why do swimming pools look shallower than they are? Why do straws look bent when they're in a drink? How can we bend light? All these questions can be answered by looking at refraction.
When light travels through air it travels at about 300 million m/s. When it travels through glass, water or any other transparent material it has to slow down. It's like running down the beach into the sea. When you hit the water you are slowed down. For light waves this can make them bend.
As the light wave goes into the block it slows down and bends towards the normal line, so angle A is always bigger than angle B. As the ray comes out of the block the light wave speeds up again and bends away from the normal line, so angle B is always smaller than angle C.
The only time light waves do not bend when changing speed, is if they are travelling along the normal line, at right angles to the boundary.
But why does the light wave bend when it changes speed? Imagine a car drives off a road onto a sandy beach. The first wheel to touch the sand (in this case the left) struggles for grip and slows that side of the car down. The right side of the car is still trying to travel at its normal speed. This makes the car swerve round to the right.
It is the same for light waves. If the ray doesn't hit the block at right angles one side will hit before the other. This slows one side of the ray down first, which makes the ray change direction.
As the light wave has slowed down its wavelength gets smaller. (The frequency does not change.) This fits with the relationship between speed, frequency and wavelength.
Why does this make swimming pools look shallower than they really are? Again it is the brain that sees a virtual image, that doesn't really exist.
The light waves leaving the brick are refracted as they leave the water, bending away from the normal line. When these waves reach the eye the brain thinks they must have travelled in a straight line, so tracks them back to a point, the virtual image. So the brain sees the brick higher up than it actually is.
Water waves will refract when they slow down, in the same way as light waves. Water waves travel slower in shallower water. The deeper the water the faster the waves can travel, in fact in the ocean waves speeds can sometimes approach hundreds of miles per hour.
Refraction of water waves happens for the same reason as light waves. If one side of the wave hits a shallow region before the other side it makes the wave change direction.
Again the wavelength of the wave changes as the speed changes. The slower the speed of the wave the shorter its wavelength will be. This keeps the frequency the same.
Sound waves refract in the same way as light waves. When a sound wave is slowed down it bends towards the normal line and when it speeds up it bends away from the normal line.
There is one big difference. Light waves slow down when they enter liquids and solids. Sound waves speed up in liquids and solids.
Sound travels well in solids because the particles are close together so vibrations can be easily passed along.