Light from the sun actually has all the colors blended. You can see them separate using a prism. Our atmosphere has things like Nitrogen and Oxygen in it, plus lots of other gases. When an atom absorbs light, the electrons jump in energy. It can't hold the energy for long, and later lets it go (all happens very fast). Most of the light energy gets converted to heat, or aborbed on the atom, but some gets dumped out in the form of light. What gets put back is what we actually see. Every atom spits out different colored light waves and the blend of what we see from all the different gases in our sky look blue to our eyes. It could look pink to an alien visitor with a different eye chemisry.