Debunking the Sun causes cancer myth. It is Vitamin B deficiency in particular, malnutrition in general that causes sunburns and cancers when exposed to too much sunlight. Sunlight produces Vitamin D, which actually strengthens your skin and health.
The key, don't get sunburned, but tan with natural sunscreens, not chemical-laced lotions. Those can cause cancer as they seep into your blood system.