The sky is blue on a clear day because of a process called Rayleigh scattering.
Light arriving from the sun hits the molecules in the air and is scattered in all directions. The amount of scattering depends dramatically on the frequency, that is, the color of the light.
Blue light, which has a high frequency, is scattered ten times more than red light, which has a lower frequency. So the background scattered light we see in the sky is blue.
This same process also explains the beautiful red colors at sunset.
When the sun is low on the horizon, its light has to pass through a large amount of atmosphere on its way to us. During the trip, blue light is scattered away, but red light, which is less susceptible to scattering, can continue on its direct path to our eyes.
According to classical physics, an accelerated charge emits electromagnetic radiation.
Conversely, electromagnetic radiation may interact with charged particles causing them to oscillate. An oscillating charge is continually being accelerated and hence will re-emit radiation. We say that it becomes a secondary source of radiation.
This effect is known as the scattering of the incident radiation.
The atmosphere is, of course, composed of various gases that together form air. We may treat each air molecule as an electron oscillator. The electron charge distribution of each molecule presents a scattering cross-section to the incident radiation.
This is essentially an area upon which the incident radiation must fall for scattering to occur. The amount of scattered radiation will depend upon the magnitude of this cross-section.
In Rayleigh scattering the cross-section is proportional to the fourth power of the frequency of the incident radiation. Sunlight is composed of various visible frequencies ranging from low frequency (red) to higher frequency (blue) light.
Because it is of a higher frequency than other visible components, the blue part of the sun’s spectrum will be scattered more strongly. It is this scattered light that we see and so the sky appears to be blue.
Incidentally we are also able to explain why sunsets are red. When the sun is close to the horizon its light must travel through more atmosphere.
The blue light will be scattered strongly whereas red light, because it is of lower frequency is less prone to scattering and so is able to travel straight to the observer.