When we hear about a mirage, we conjure an image of a dehydrated individual stumbling through the desert and mumbling about water. In their delirium, they see what looks like a section of water in the vast sand. When they expend their last reserves of energy climbing up the sand dune to get to it, they are crushed to find only more sand ahead of them.
While it could be easily attributed to a water-starved mind, seeing water (or what looks like water) on a hot surface ahead of you is not a sign of psychosis. When you see a mirage, you are actually seeing a reflection of the sky on the ground.
A mirage as we typically think of it has everything to do with refraction. First we have to consider the circumstances involved. When we see a mirage, it is usually above a hot surface like a road on a sunny day. The air directly above the road is much warmer than the air above it. This is important, as the density of the air (determined in part by temperature) affects refraction.
Cold air is denser than warm air, and therefore has a higher refractive index. This means that light will be bent more as it passes through a medium with a higher index. Because the photons of light bump into more matter (in a more dense material) it slows down, and therefore bends. As light passes from a low index to a high index, the light bends towards a line perpendicular to the medium boundary. Conversely, when light travels from a high index to a low index, the light bends away from this line. You can see both these phenomena below:
So how does this make us see a reflection of the sky, as I mentioned above? Remembering the refractive index, a mirage is created when light from the sky passes from colder air to the much hotter air near the ground. Given that the temperature change is great enough, the light from the sky can be refracted by the hotter air before it hits the ground and up to your eye!
You can see from the image above what is going on here. The “light ray from sky” is bent or refracted as it passes from a high index to a low index and up to your eye. But this doesn’t completely explain why we see mirages. Our brain also plays a trick on us.
As you can see in the image above, even though the light ray that we are seeing is refracted light from the sky, our brain follows the apparent path of the light ray to its imagined origin. Since our brains are used to interpreting light coming to us in straight lines, our brain assumes that the refracted light also follows a straight path. Because of this, we follow the light back to the source, which appears to be the ground.
Combining all of this together, refracted light from the sky is interpreted as straight, letting us see an image of the sky on the ground. This is why many mirages appear as blue water. We think we have stumbled on an oasis when in reality we are seeing a shimmering image of the blue sky. Since our brains doesn’t recognize the sky as being on the ground, we imagine the image to be shining blue water. If the sky were green, perhaps we would have mirages of green grass.