Dispersion, not refraction. "Rayleigh scattering" to be specific, after the chap who figured it out.
There isn't really such a thing as "the sky" - the atmosphere appears blue when there's light shining through it (and for a little while afterwards). That diffuse blueywhiteness is all around you and just gradually tapers off into space. It's exactly the same blueywhiteness you see between yourself and distant objects/landscapes even though it's not usually called "sky" when there's something discernible behind it. "The sky" (if there was any such thing) would probably be better considered black - the beginning of space by some inane & arbitrary altitude/density/pressure definition. We just typically view it through a load of blueywhitish atmosphere.