The prevailing theory involves damage to the DNA of skin cells.
It is the shorter UVB rays, which penetrate only the top layers of the skin, that are suspect, while the longer and more deeply penetrating UVA rays cause wrinkles and aging.
In tissue cultures, UV damages the DNA of cells, but humans have an enzyme that repairs it. Due to a genetic defect, some people lack the repair enzyme.
The hypothesis is that in the body such DNA damage occurs all the time and is constantly repaired, but some cells do not get repaired, or get repaired improperly, and this is how skin cancer begins.
Researchers found a specific kind of DNA damage in a gene called CQ that occurs in this way. In the error, two DNA units of the type designated as thymine are side by side, instead of two units of the cytosine type.
The error is called a thymine dimer. It is presumed that the brakes on cell multiplication come off because of it, leading to uncontrolled proliferation of cells into a tumor.
Ultraviolet radiation is implicated in the vast majority of nonmelanoma skin cancers, like basal cell carcinoma and squamous cell carcinoma. It is also linked to melanoma, though less clearly.