Skin cancer develops because of damaged DNA. DNA is the main molecule that directs and controls every cell in the body. Cells lose control because damaged DNA and they become cancerous and mutations of DNA can also be inherited.
Exposure to ultraviolet light can damage the DNA which is in skin cells and thereby increase person's risk for both non-melanoma and melanoma skin cancer.
Ultraviolet is invisible radiation which is from the sun and can damage DNA. Cells of the skin are susceptible to DNA change because of frequent exposure of ultra-violet.
The three types of Ultraviolet radiation are A, B, and C. They are dangerous and can penetrate the skin cells. UVA is common on earth and its harmful to the skin. UV B is less common because is absorbed by the ozone layer the same case applies to UV C.