It's a warm day and the sun's beating down on the dark asphalt road. You look ahead and see a shimmering wet area on the road in front of you. The wet spot keeps retreating from you as you move along the road. A mirage on the road Light passing through two air layers of different temperatures causes mirages if the light hits at an oblique angle. The greater the angle, the better your chances of seeing a mirage.
Warm air is less dense than the cold air and light travels faster in thinner air.
The speed difference bends light rays. It works like this. See Figure 2. The dark asphalt absorbs heat from sunlight and heats the air directly above it. If the temperature were the same everywhere, the light from the sky would come down, meet the road, and you would not see a mirage.