Normally, light travels in a straight line, but it will change direction depending on what it passes through. This bending is called "refraction." Gases, such as air, become thinner as they get warmer. As a result, light tends to curve (or refract) towards the colder layer of air. This makes the image appear to come from a different direction than the original object.