Exposure to ultraviolet (UV) radiation is a major risk factor for most skin cancers. Sunlight is the main source of UV rays. Tanning lamps and beds are also sources of UV rays. People who get a lot of UV exposure from these sources are at greater risk for skin cancer.