The Sun is seen little before it rises and for a short while after it

The Sun is seen little before it rises and for a short while after it sets. This is because of

total internal reflection
atmospheric refraction
apparent shift in the direction of Sun
dispersion
This question was previously asked in
UPSC NDA-1 – 2019
The phenomenon of seeing the Sun slightly before it rises and after it sets is caused by atmospheric refraction.
– Light from the Sun bends as it passes through the Earth’s atmosphere, which is denser near the surface.
– When the Sun is below the horizon, the light rays from it are refracted (bent) downwards as they enter the atmosphere, making the Sun appear to be above the horizon to an observer.
– This effect causes the Sun to be visible for a few minutes before its geometrical sunrise and after its geometrical sunset.
The amount of refraction depends on atmospheric conditions, but it typically makes the Sun appear about 0.5 degrees higher than its true position on the horizon. This also contributes to the apparent flattening of the Sun’s disc when it is very low on the horizon.