Does the Sun cause Cancer

We have been told that the UV rays of the sun causes a higher rates of melanoma and other forms of skin cancer.  This could be true if you have a compromised immune system that does not consume adequate nutrients, especially healthy fats.