Aerosol sprays are often flammable, including many sunscreens and bug sprays. They say so right on the label, in small print, which I’m going to guess you generally don’t bother reading as you’re sunscreening up next to a grill or tiki torch.
Sunscreen sprays typically include alcohol (or a similarly volatile chemical) to help carry the sprayed-on substance from the can to your skin. Once it’s on your skin, it makes a thick, wet sheen, which is good ” it means you’ve applied enough.
But while it's wet, it's still flammable. The spray itself can also be flammable while it's in the air, and while we're talking about fire hazards it's worth mentioning that aerosol cans may explode if they overheat, so keep that can of sunscreen away from the campfire.
A few years ago, a man burned himself on his grill immediately after applying sunscreen, leading a news crew to get a firefighter to ignite a mannequin arm in a reenactment.
To be clear, it's only the wet spray that is flammable. Once the sunscreen has dried on your skin, there doesn't seem to be any elevated danger. In the case of the man with the grill, it's likely that a faulty spray nozzle caused too much spray to be dispensed, with the result that the spray didn't dry within the time you might reasonably expect.
So when you apply spray sunscreen, stay away from open flames while you do it, and make sure that the spray dries completely before you step up to the grill.