The temperature (and pressure) gradient in the atmosphere causes bending of light rays. This is called atmospheric refraction. Light rays from the low sun or moon will refract more closer to the horizon. This is why the setting or rising sun (and moon) appears flattened: the light rays from the lower part of the sun's disk refract more than the rays emerging from the top, and the vertical angle over which you see the sun is decreased - it is flattened.
6 photos in gallery
Click images for large photos