I was asked why a bucket full of water looks shallower than an empty one, so I pulled out an old physics book to find the answer. It's been many years since I've taken optics, although recently I've developed a new interest for it.
Refraction occurs because the speed of light changes based on the density – something I discussed here. The refractive index is the ratio of the speed of light in a vacuum to the speed in the medium. If we think about water with its refractive index of 1.33, we find that light travels 1.33 times faster in a vacuum than the water. The denser the medium, the greater the difference in speed of light and the bigger the refractive index.
Not only does light slow down, it also bends. When a ray of light hits a surface at an angle (angle of incidence) it gets bent to a new angle (angle of refraction) inside the surface. With a little trigonometry applied to these angles, we find that their ratio is also the refractive index, a trick discovered by Willebrod Snellius (of Snell's law fame) in 1621 – although an Arab scientist figured this out almost 500 years earlier.
So, what fun can we have with the refractive index? Ever looked into a still pool of water? Due to light rays bending in the water, the pool will look ¾ the depth it actually is. If a post sticks up through the water, it will look oddly disjointed at the surface – appearing to extend at one angle above the water and another below the surface even through the pole is straight.
From another point of view, what does a fish see when it looks up? A fish sees a lot more than expected. By looking up in a cone of 98 degrees, a fish gets a 180 degree view above the water due to refraction. The view above the water would be strange – someone fishing on the shore would look excessively squat, standing at an odd angle and probably distorted due to ripples on the surface. But, the fish would see the fisherman, making it much more difficult to be successful at fishing (spear fishing is even more complex due to refraction). By the way, if you put on your goggles and hopped into the local swimming pool, you would see what the fish sees.