See the attached figure.
When the sun is at the horizon, the rays travel more distance through the Earths atmosphere.Hence they get scattered more, and red, having highest wavelength,travels faster.
When sun is overhead, it traverses less distance in the atmosphere and thus has less scattering.
This is also the reason why it looks bigger at sunrise and sunset.