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.
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.