There are both benefits and risks to sun exposure. A balance is needed between adequate vitamin D levels and increased risk of skin cancer.
Given the health risks, using sun beds and solaria is not recommended.