The skin contains a pigment called melanin. It colors the skin, imparting the variety of skin tones we all recognize. Melanin blocks at least some of the UV rays from penetrating the skin. After repeated or prolonged exposure to UV rays, the skin produces more melanin. Consequently, the skin darkens, or tans, which in turn protects the skin.