Although exposure to ultraviolet rays is a primary cause of skin cancer, factors such as your age, sex, and smoking habits also may contribute to developing this health issue.