We already discussed the basics of why the sky is blue. Why then, are sunsets red, and all those other gorgeous colors?
Light from our star, the Sun, is made of many different frequencies/wavelengths. Some of it visible, some of it not. When light hits our atmosphere, the light strikes molecules that cause them to scatter. This is called Rayleigh Scattering.
Normally we get a blue sky, but at special parts of the day, we get beautiful sunsets and sunrises.
This occurs because the sunlight has to go through more atmosphere than normal. Usually only the shortest wavelengths get scattered. But, at sunrise and sunset, the sunlight has to travel a longer distance to reach you, so more light gets scattered and reflected (separated). This produces all of the yellows, oranges, and reds.
Now, the actual colors you get to see at sunset vary depending on the make up of the atmosphere where you are. The cleaner the atmosphere, the less the scattering, the more yellow your sky (the less red your sunset).
For a more discussion on the effects of particles/aerosols and purple sunsets visit Causes of Color.