On hot summer days, the air near the ground becomes hotter than the air at higher levels.
The refractive index of air increases with its density. Hotter air is less dense and has a smaller refractive index than cooler air. If the air currents are small, that is, the air is still, the optical density at different layers of air increases with height.
As a result, light from a tall object such as a tree passes through a medium whose refractive index decreases towards the ground.
Thus, a ray of light from such an object successively bends away from the normal and undergoes total internal reflection, if the angle of incidence for the air near the ground exceeds the critical angle.
To a distant observer, the light appears to be coming from somewhere below the ground and naturally assumes that light is being reflected from the ground, say, by a pool of water near the tall object.
Such inverted images of distant tall objects cause an optical illusion to the observer. This phenomenon is called a mirage.
This type of mirage is especially common in hot deserts.
Some of you might have noticed that while moving in a bus or a car during a hot summer day, a distant patch of road, especially on a highway, appears to be wet. But, you do not find any evidence of wetness when you reach that spot. This is also due to mirage.