Here's how it works:
* Light Bends: When light travels from one medium (like air) to another (like space), it changes speed and direction. This bending of light is called refraction.
* Earth's Atmosphere: Our atmosphere acts like a lens. It's denser near the ground and less dense higher up. As sunlight enters the atmosphere, it gets refracted, bending towards the denser air.
* Sunset Illusion: When the Sun appears to be setting, it's actually already below the horizon. But the light rays from the Sun are bent by the atmosphere, making it seem like the Sun is still above the horizon.
This effect is strongest at sunset and sunrise, as the light has to travel through a longer path of atmosphere. It also explains why the Sun looks flattened or oval-shaped near the horizon, as the bottom of the Sun is refracted more than the top.