Sunscreen can help prevent sunburns that are a major risk factor for skin cancer, when used correctly. But not all sunscreens are created equal: some offer more or less protection from different kinds of harmful rays, and some contain ingredients that are linked to increased cancer risk. One of those additives, vitamin A (sometimes referred to on labels as retinol) may even speed the development of melanoma. And then, there's the whole controversy around nanoparticles, and various additives linked to possible hormone disruption.
The Environmental Working Group's 2013 Guide to Sunscreens is a great place to start, when shopping for safe and effective sunscreens.
Their "9 surprising facts about sunscreen" is pretty good too, and while it is a listicle, it is mercifully not a clickthrough sideshow.