In a desert, the air close the sand is very hot and is lighter. The air at 1/2 meter or 1 meter height is cooler and so denser. The light rays from a distant tree or building top are incident on the boundary of the these layers of air. They get totally internally reflected when the angle of incidence is more than critical angle.
When a person sees the reflected light rays, the person assumes the rays are emanating from an image below the horizon level. The persons assume that there is a water lake and the image is appearing due to water being there.
This false (virtual) image is called the mirage.
examples: In hot summer, during an afternoon if you are travelling on a tar road, you might see wavering images of buildings or trees in the air close to the road. It appears as if the roads are wet.
When a light ray is incident on a boundary between an optically denser medium μ₁ and a lighter medium μ₂, then total internal reflection can occur.
Refractive index μ of a medium gives the optical density of the medium.
Let the light rays pass from the optically denser medium (μ₁ > μ₂) into the lighter medium, the angle of refraction "r" is more than the angle of incidence "i" at the boundary between them. They are related by :
μ₂/μ₁ = Sin i / Sin r = constant
As i increases, r also increases. At a particular angle called the critical angle "i_c", the angle of refraction becomes 90° and grazes the boundary. When the angle of incidence is increased further, the light rays are all totally reflected back into the denser medium. The reflected rays follow the laws of reflection.