Hi,
UV rays are blocked by the ozone layer high in our atmosphere. The
ozone blocks some kinds of UV light better than others. For instance,
the UV light that is lower in energy (just a little bit bluer the
blue!) can get through more easily. For some of these energies the
atmosphere acts like a dirty window - some of the light can still get
through.
Also, the ozone is thinner at some times and places (you may have heard of the ozone hole in Antarctica).
Terry