A mirage occurs when the air density difference caused by extremely hot temperatures causes photons to travel in a path other than a straight line. Hot air is less dense than cold air, so if there is a significant temperature gradient, the light reflected from an object may be refracted. This can distort the image.
One of the most common types of mirage is the inferior mirage, in which the appearance of objects on the ground changes. These occur during periods of intensely hot weather, when the sun's energy heats the ground to a temperature that is significantly hotter than the air above it. This causes the reflected light from objects to move downward, projecting images into and onto the ground. For example, mirages of water in the desert occur when the blue sky refracts through the hot air and appears to be part of the ground. Heat haze on and above asphalt is another example of an inferior mirage.
Superior mirages occur when the ground is much colder than the air above it. In these mirages, objects appear to be floating in the air above their actual position. A Fata Morgana mirage combines inferior and superior mirages when air conditions are unstable and may cause images of faraway objects to dance and distort.