Solution:The mirage is caused by the refraction and total internal reflection of light at layers of air of different densities. In Desert areas, the successive upper layer is denser than those below there due to terrestrial heating.A ray of light coming from a distant object, like the top of a tree gets refracted from a denser to a rarer medium. Consequently, the refracted ray bends away from the normal until at a particular layer, the light is incident at an angle greater than the critical angle.
At this stage, the incident ray suffers total internal reflection and enters the eyes of the observer. It appears as if an inverted image of the tree.