Sun tan is primarily caused by the skin's exposure to ultraviolet (UV) radiation from the sun. When the skin is exposed to sunlight, it produces more melanin, a pigment that darkens the skin to protect it from UV damage.