Today I found out why the sky is blue.
For the short answer, when light from the sun enters our atmosphere it collides with molecules in the air. The blue part of the light gets scattered more than the other parts during these collisions and thus makes the sky appear to our eyes as blue. If the light from the sun took a straight path down to our eyes with no scattering or absorption in the atmosphere, the sky would in fact look much as it does at night in the day time, which would be kind of awesome in my opinion.
So a little background. White light waves from the sun are in fact mixtures of all colors of the light spectrum. Anyone who’s ever had a prism knows that when white light shines through it, the light gets separated and you get a rainbow spectrum showing up on the other side. Humans can only see a portion of the total light spectrum of energy; we see from Violet, which has a wavelength of about 380 nanometers, to red which has a wavelength of about 720 nanometers. Descending from red to violet, we get orange, yellow, green, blue, and indigo between the two.
Another needed piece of information is that the atmosphere of the Earth is made up of almost all nitrogen and oxygen.
So without getting too technical, what is happening here is that oxygen, which makes up 21% of the Earth’s atmosphere, has a diameter such that it fairly effectively scatters radiation that has a wavelength of around blue-ish light, while the reds, oranges, and others more or less passing straight through the atmosphere without being scattered much at all. So when you look up at the sky, everywhere you look looks blue as the blue portion of the light spectrum bounces off an oxygen molecule and into your eye.
It actually turns out that the Earth’s atmosphere is also scattering quite a bit of violet light as well. So why doesn’t the sky look more like a blueish/violet? This is for a few reasons. Most important is that our eyes are most sensitive to blue, red, and green. So our eyes are naturally more inclined to respond to blue over violet. Also important is that the sun doesn’t put out light at the same intensity at all wavelengths of the spectrum. In addition to this less amount, some of the violet also gets absorbed in the upper atmosphere; so not as much of it gets to our eyes. So it turns out more or less a combination of these three things makes it so we see the sky as blue instead of violet or blueish/violet. It is interesting to note however, that our eyes are picking up some of the violet and indigo being scattered. Without this, we would in fact see the sky as more of a blueish green. This is because the green cones in our eyes respond to the small amounts of scattered yellow light wavelengths to some extent; meanwhile our eye’s red cones respond to the indigo/violet somewhat which balances things out a bit and so we only perceive the blue being scattered.
So you might now be asking, “Why is the sky red or orange when the sun is setting?” What’s going on here is that as the sun is setting, the light you are seeing from it is having to travel through a lot more atmosphere given your angle to the sun. Light at lower wavelengths gets scattered more than at the higher wavelengths. So less of the blue light gets to you as it’s being scattered more than, for instance, yellow, orange, and red. In this case, if it is a relatively clear day, the sky will appear more yellow than blue as you watch the sunset because the blue is being scattered so much it never reaches you or at least, not as much of it, but the yellow isn’t scattered nearly as much but still scattered enough to make the sky look yellow. If it is dusty or there are a lot of other types of particles in the air along the path to where you are looking at the sun, the sky will appear more red. If there is a lot of salt in the air, such as at sea, it will appear more orange.
So, if there was no scattering or absorption, the sky would appear black in the day time. If there was more absorption or scattering going on than there is, then the sky might appear to us to be yellow, orange, or red all day long.