Sunburn is the term for red, sometimes swollen and painful skin. It is caused by overexposure to ultraviolet (UV) rays from the sun. Sunburn can vary from mild to severe. The extent depends on skin type and amount of exposure to the sun. Sunburn is a serious risk factor for skin cancer and for sun damage.