Mirage, in optics, the deceptive appearance of a distant object or objects caused by the bending of light rays (refraction) in layers of air of varying density.
Mirage is caused due to total Internal Reflection of light by the various layers of air. It is an optical illusion which is responsible for the appearance of the water layer at short distances in a desert or on the road. Mirage is an example of total internal reflection which occurs due to atmospheric refraction.
When the light rays from the sun travel straight through the atmosphere, these light rays travel at different speeds through the hot and cold air. For mirage to occur the ground should be very hot and the surrounding air cold. The layer which is above the ground gets warmed. The light ray gets refracted when the light moves through the cold air and into the hot air layer. This is how mirage occurs.