We know that light refracts (or bends) when it goes from one medium to another. Now, the atmosphere contains only air. Then how does light get refracted on passing through only air in the atmosphere?
We know that light refracts when it travels from one medium to another. Though the earth's atmosphere contains only air, refraction takes place because the atmosphere consists of layers of air that are at different temperatures. The layers of air that are hotter behave like an optically rarer medium and those that are cooler behave like an optically denser medium. Therefore, when light travels through these layers of air of different optical densities, bending of light, or refraction, takes place.