Sometimes thirsty traveler in desert sees the inverted image of a distant tree and thinks there is water. When he comes close to the tree he realizes his mistake that there is no water. This happens due to total internal reflection of light. This very event is called mirage.
The sandy surface of desert is rapidly heated by the tremendous heat coming from the sun. So, the layers of air in contact with the sandy surface become hot. As a result the lower layers become hot and lighter but the upper layers are comparatively colder and denser. The ray of light coming from the tree enters continuously into rarer medium from denser medium. As a result the refracted ray continues to go away from the normal.
In a certain moment the ray of light incidents on a layer at an angle which is greater than the critical angle and total internal reflection occurs. At that time the upside down image is seen and we call it mirage.
Observation: While walking or travelling in vehicle on a pitch covered road during summer days you may have noticed that the road is wet and silvery. It seems that there is water on the road. A similar phenomenon like mirage in a desert has happened here.