Mirages are tricks played on the eye by light.
The most typical weather-related mirage is that of a shining pool of water in a hot desert. Bent sunlight creates this optical illusion on very hot ground.
Surfaces that are heated to 120° Fahrenheit (49° Celsius), such as midday desert landscapes, radiate a thin (less dense) layer of very hot air that hovers over the ground.
Above that layer rests a colder (more dense) air mass. As sunlight passes through the cold air to the hot, the rays are bent so that they reflect an image of the sky.
The shimmering heat makes the reflection look like a pool of water.
Air masses can also cause cold-weather mirages. Frigid surfaces create a very cold layer of air just above the ground with a warmer layer above it.
When the sunlight passes through the warmer layer to the cold, it bends, reflecting not the sky, but the surface just over the horizon.
This fascinating trick can create whole towns that seem to float in the air.