We know that light refracts (or bends) when it goes from one medium to another. Now, the atmosphere contains only air. The how does light get refracted on passing through only air in the atmosphere ?
The atmosphere of earth consists of different layers of air. Out of these some air layers are hot which have low densities, while the others are cold which have high densities. The hot layers of air behave as optically rarer medium for light rays, whereas the cold layers of air behave as optically denser medium for light rays. So, when an object emits light rays in the atmosphere, these light rays pass through the atmosphere having different air layers of different densities and get refracted by atmosphere. So, the refraction of light caused by the atmosphere of earth is called atmospheric refraction.
Science for Tenth Class - Part I - Physics