Excessive exposure to sunlight is the main cause of skin cancer. Sunlight contains ultraviolet (UV) rays that can alter the genetic material in skin cells, causing mutations. Sunlamps, tanning booths, and X-rays also generate UV rays that can damage skin and cause malignant cell mutations. Basal cell carcinoma and squamous cell carcinoma have been linked to chronic sun exposure, typically in fair-skinned people who work outside. Melanoma is associated with infrequent but excessive sunbathing that causes scorching sunburn. One blistering sunburn during childhood appears to double a person's risk for developing melanoma later in life. Read more about the basics of skin cancer.