That happens mainly due to refraction.
Refraction is the bending of Light Rays when it enters an optically denser medium from an optically rarer medium.
Light rays from the sun while enter the earth's atmosphere it bends upwards.
This is why we see the sun(its rays) earlier than the sun actually rises.
Infact, 2 minutes before.
Had there been no atmosphere, this would not take place.