The usual explanation is that material in the atmosphere scatters the light from the sun as it passes through.Blue light has higher energy than the other wavelengths and therefore manages to penetrate with little scattering.We therefore see the sky as blue;all the other wavelengths having been scattered to a greater or lesser extent