You get a tiny break for medically necessary aerosols, like asthma inhalers. They don’t have to fit in the 3-1-1 bag, but you still need to declare them separately. So, yes, you can bring your rescue puffer without having to throw away your Face Mist to make room.
For non-medical stuff like spray sunblock? It must follow the 3.4-ounce rule. Don’t even think about sneaking a full-size can of sunscreen in your carry-on unless you want to watch a TSA agent lovingly toss it into a bin of confiscated treasures.
The fun exceptions (a.k.a. “Why can’t I bring hairspray to Paris?”)
Aerosols that are flammable—like most hairsprays, spray paints, and cooking oils—are allowed in checked bags, too, but with a 2-pound weight cap per can and a 70-ounce total limit. That’s enough hairspray to make your hair stiff for a month—or to start a tiny campfire, but let’s not. Seriously, please don’t pack a can of butane in your carry-on. The plane already has enough pressure jokes.
What about mace or pepper spray? Hoo-boy, that’s a separate headache. The TSA allows pepper spray in checked bags only if it’s 2 ounces or less, and it needs a safety cover. You cannot bring it in your carry-on unless you want to explain to a security officer why you need to chemically assault a chair. Just… don’t.