One of the interesting things about UV radiation is that it is reflected by different surfaces. These reflections can amplify the effects of UV exposure. That is why you can get snow blindness and severe sunburns from skiing on a sunny day. On the other hand, certain things absorb almost all UV radiation partially or completely.
Most sunscreens use chemicals that have the same UV-absorbing properties.
So, now that we know all about the skin we can start to actually understand tans and sunburns. When you get a tan, what is actually happening is that the melanocytes are producing melanin pigment in reaction to ultraviolet light in sunlight. Ultraviolet light stimulates melanin production. The pigment has the effect of absorbing the UV radiation in sunlight, so it protects the cells from UV damage. Melanin production takes a fair amount of time - that is why most people cannot get a tan in one day.