When UV radiation penetrates the skin, it can damage the DNA in skin cells. This damage can lead to mutations in genes that control cell growth and division. If these mutations occur in specific genes, such as tumor suppressor genes or oncogenes, they can lead to uncontrolled cell growth and ultimately result in cancer. Both UVA and UVB rays have been implicated in skin cancer, although they affect the skin in different ways.