In our previous DYKW post we had seen that why the sky is blue. The next question comes, why is the sunset red. The answer is very simple as you have already understood the reason for blue sky. It is because of refraction, we see the sun set as red and the sky as blue.
The refraction is caused by the Earth’s atmosphere. The atmosphere determines what color the sunset should have and what color the sky should have. As you know, the atmosphere is composed of gases. We have already discussed that light moves in straight line if it is not disturbed by something. The light that hits dust particles reflects off to a different direction and this light will have white color as it carries all the colors in it.
However, when light hits gas molecules, some of it may get absorbed. Though all of the colors can be absorbed, higher frequency lights (blues) are absorbed mostly in comparison to the lower frequency lights like reds. After absorption, gas molecules radiate these absorbed lights. This is the reason why we see the sky blue.
Now, why the color of sunset red? During sunset, the light must travel farther through the atmosphere to reach your eyes. Due to this reason, much of the light is reflected or absorbed on its way. It means, only the longer wavelength lights (reds) are capable to reach us. And so, we see the sunset red.