What do you see when you place a pencil in a glass of water?
The pencil appears to bend where it enters the water. The pencil is not really bent. The light we see has bent as it moves from water to air. This is called refraction. This occurs because light moves more slowly in water than in air.
You can see how this happens by looking at lines of marchers with their arms intertwined moving from pavement onto sand. The marchers move faster on the pavement than in the sand. If the marchers in a given line all move from the pavement to the sand at the same time, nothing happens to their direction of movement. However, they slow down, causing the lines of marchers to be spaced closer together. Their direction of travel does not change.
If a line of marchers moves at an angle from the pavement to the sand, the line bends because the marchers in the sand move more slowly than those still on the pavement. It is this effect that makes the pencil look bent.
Sound is refracted just as light is. Refraction occurs not only when light moves from water to air, but whenever the speed of light changes. Similarly, a sound wave traveling through the ocean is bent whenever it encounters changes in the speed of sound. Since sound speed changes with changes in temperature, salinity, and pressure, a sound wave will refract as it moves through the ocean.