The Sun is visible to us about 2 minutes before the actual sunrise, and about 2 minutes after the actual sunset because of atmospheric refraction. During sunrise, the light rays bend due to our atmosphere and the observer sees the sun early even though the sun is just below the horizon. Similarly, at sunset, due to the same bending of light rays, the observer sees the apparent position of the sun, not the actual position.