# Do mirages really occur due to total internal reflection?

Mirages occur in areas such as deserts due to difference in the refractive indices of layers of air. As the light ray travels from denser to rarer layers of air, slowly bending, it approaches the critical angle and after refracting, it goes along with the boundry and the angle becomes 90 degrees. Now this light ray becomes the incident ray and if this ray undergoes total internal reflection, its angle of reflection would be 90degrees which means it would never bend, but in case of mirages, the ray bends in the upward direction. Does this mean that mirages dont occur due to total internal reflection?

$$`$$