Last weekend, some barbecuin' went down. Rib grease on your fingers. Ketchup stains on your shorts. Chip crumbs on your t-shirt. And sunburn everywhere else.

Or maybe you did the sensible thing, and smeared sunscreen all over your body. You trusted it, and it came through. But have you ever wondered how the stuff works?

"It’s just physics and chemistry, essentially," says Dr. Steve Wang, head of dermatology at the Memorial Sloan Kettering Cancer Center in New York City. Ultraviolet radiation from the sun hits your skin at wavelengths ranging from 290 to 400 nanometers. This span includes both UVA and UVB radiation, though it's the UVBs—with wavelengths ranging from 290 to 320 nanometers—that are the bigger threat.

The energy in that radiation has to go somewhere, and without sunscreen it goes into the fat and proteins in your skin. This generates free radicals, which subsequently damage your cellular machinery—including its DNA. In the short term, that damage triggers an inflammatory response. Your blood vessels dilate—making your skin turn red—and your immune system releases a flood of proteins called cytokines to the burnt area. Cytokines are the little jerks behind the awful pain that happens later when you try to put on your shirt, strap on your seat belt, take a shower, or touch anything, really. "It’s the body’s way of telling you that damage has occurred," says Wang.

Woman applying sunscreen, mid section, close-up Getty Images

The radiation also introduces mutations in your skin cells' DNA. And because the turnover of skin cells is so high—every 28 days the new replace the old—there's a high probability that these mutations will get passed along. And genetic mutations, my friend, are the genesis of cancer.

Unless you wear sunscreen. "It's solving a physics problem, because that energy has to go somewhere," says Wang. There are many protective ingredients in sunscreen, which fit broadly into two groups: organic and inorganic. In this case, organic doesn't mean the chemicals were harvested on a pesticide-free farm by people wearing Tevas. In chemistry terminology, organic just means that the chemical structure is built out of carbon molecules—in this case, rings of them.

Organic sunscreen chemicals take advantage of the first law of thermodynamics. "Energy has to go somewhere," says Wang. And where it goes is into the chemical bonds holding the ring of carbon molecules together. Robbed of some of its energy, the ultraviolet ray is far less effective at causing the free radical chain reaction. The organic molecules, fulfilling their end of the thermodynamic bargain, release the absorbed energy as heat. (And no, Dr. Wang says, there have been no studies showing that people who wear sunblock are noticeably warmer in the sun than people without it. Had to ask.)

Inorganic molecules (no carbon ring) also do some of the absorption work, but they physically deflect the ultraviolet waves as well. (And no, Dr. Wang says, there is no evidence that people who wear sunblock are noticeably shinier in photographs than people without it. Had to ask.)

This is pretty much how all sunscreens worked back in the day—the white stuff that smeared the nose of every dopey 80's dude from Jeff Spicoli to Kevin "Ug" Lee. But that same decade was when scientists figured out how to make these reflective atomic chains smaller. "And by making the size smaller you actually shifted the wave of protection to smaller wavelengths," says Wang.

But small particles—mostly organic—raised health concerns with some watchdog groups. The problem, according to the Environmental Working Group (which issues a safe sunscreen guide every year), is that most sunscreens use an organic compound called oxybenzone, which has been linked to hormonal disruptions. In rat studies, this caused uteri to swell up to 23 percent in size. Other studies have shown that human oxybenzone levels increase after using sunscreen. This is because unlike most of the chemicals in sunscreen, oxybenzone is smaller than 13 nanometers, which means it can slip through the gaps in your outermost layer of skin.

Wang investigated these claims, along with concerns about another sunscreen substance, retinyl palmitate, that has been linked to cancer. He says that while the rat studies are compelling, they don't tell the whole story. "What people need to understand is the toxicology," he says. "You need to figure out the exposure level to know how much of a hazard these really are." Wang's research showed that a human would need to be applying sunscreen every day for decades to accumulate toxic levels of oxybenzone. He did similar work, with similar findings on retinyl palmitate. (And no, Wang did not receive funding from the sunscreen industry.)

Oxybenzone doesn't get off completely scot-free: The National Park Service and others have linked concentrations of the stuff—washed from swimmers' bodies—to coral die-offs.

And what about that other sunscreen bugbear: That using it blocks helpful Vitamin D? Hogwash. Yes, sunscreen does interfere with your body's ability to make this essential vitamin, but that really doesn't matter because you're probably not using sunscreen properly.

Wait a second. How do you mess up putting on lotion? Let's start with the basics. First of all, you're probably not using enough. Measure out a shot glass of lotion, then dump that into your hand. Remember what it looks and feels like. "You need two milligrams of sunscreen per square centimeter of skin," says Wang, so about an ounce and a half should be enough to cover your arms, legs, torso, and face. Also, make sure you're putting it on before you head outside. The American Academy of Dermatology says your skin needs about 15 minutes to fully absorb the lotion. Otherwise, you're going to be burning while you wait for the stuff to settle.

And make sure you reapply often. SPF isn't like some weird percentage value of how much solar radiation the stuff blocks, it's a multiplier telling how long the sunscreen extends your burn free sun time. "If your skin takes five minutes to burn and you put on SPF 30, now you have 150 minutes," says Wang. Is that too weird to calculate? Every two hours is a safe bet, no matter what SPF you're using. If you're getting sweaty or swimming, do it a little more regularly.

But the most incorrect way to use sunscreen is for making fun patterns on your body, which is apparently a hot trend with the kids this summer. So lather up Junior, unless you want a Batman-shaped squamous cell carcinoma across your chest.