Now bear with me for a second, I promise this one is not hard.
Light comes in units called photons. When these photons find big obstacles they bounce off them, just as a rubber ball would. This is essentially how we can see stuff. In this context photons behave as particles.
Now enters quantum mechanics. As I said before, bear with me here, you do not need to understand any of the weird facts to learn why the sky is blue!
Photons also have the properties of waves, which can be seen when light interacts with smaller objects. For example, when light crosses a small hole, it produces a diffraction pattern very much like the waves in a lake would.
These wave properties explain a lot of interesting phenomena, like interference and the famous double-slit experiment, one of the pillars of quantum mechanics. This wave-like nature of light is also used to probe periodical structures, like crystals or our DNA.
Blue in the morning
Rayleigh scattering explains the interaction of light with very small objects, smaller than its wave-length, and is related to the wave-like characteristics of light. This scattering is more likely for shorter wavelengths. This means that this scattering is more intense for blue light than it is for red light.
While almost 25% of the blue light is scattered in our atmosphere, only under 5% of the red light will be scattered. As a result, lots of blue light reach our eyes from anywhere in the sky, while very little red light does. This creates a blue sky. The Sun, on the contrary, looks yellowish because it is missing more blue light (scattered) than red light.
Red at night
We have seen that blue light scatters in the atmosphere more than red light does, giving our sky its blue colour. Then, how comes the sky at dusk is red?
This is because when the Sun is close to the horizon, light has to cross a much longer path of atmosphere. And blue light scatters a lot, and in this process it loses intensity (scattered in every direction, lost back to space, absorbed in trees and mountains, heating up dust particles in the sky…). Red light scatters much less, traveling in a mostly straight line, which results in a relatively short path, which means less decrease in intensity.
This can be best understood looking at the image above of an opalescent glass. The glass scatters blue light, hence its colour. However, light is orange through the glass, because more blue has been lost in the way. This is why we see a red sky at dusk, because a lot of blue has been lost in the long way.
Blue again if you look up high!
This is all very nice, but the sky at dusk is red only close to the horizon. If you look up higher, it is deep blue!
The light we see “coming” from higher in the sky has travelled through a lot of higher atmosphere before being reflected towards our eyes. And higher in the atmosphere there is a lot of ozone (yes, the famous ozone layer), and ozone absorbs red light. Blue light is still scattered more than any other colour and most is lost in the way, but in the stratosphere (about 10–50 km high) ozone “eats” red light. The result is blue again, but a deeper, darker blue that finally meets the black of the night.
Sorry about all those coloured words, I couldn't resist it!