Sunbathing is great for you. It is also the best way to prevent sunburn. How? How do you prevent a hernia? By doing a sit-up with a 500 pound weight? No, you work up to it. How do you learn calculus? Do you take a course on it in kindergarten? No, you work up to is by taking easier math classes. So you avoid sunburn by gradually increasing your time in the sun so that your skin gets darker and darker. I should make a hub about it.
Pease note that if you only go out in the sun before 10:00 AM and after 3:00 PM you will get plenty of UV-A but you will not get enough UV-B to give you vitamin D.