Refraction of Light
Due to the differences in density of the atmosphere, the light coming from vacuum is bent when it enters the atmosphere.
This bending of light causes mirages and the wavering of light above hot objects. It also causes the stars to twinkle. It also causes the sun to appear to rise earlier and set later than it really does - because of the way the light is bent.