A cough in your face (Legal question)

Suppose Person A (for Asshole not wearing a mask) deliberately coughs or spits in Person B’s (who is wearing a mask) face. So, to discourage Person A from repeating this action, Person B gives Person A a 5 - 10 second shot of pepper spray in his face. What sort of action might a prosecutor or law enforcement take against Person B?

Depends on the laws in force in the jurisdiction concerned.

In England and Wales both might be had up for common assault. I highly doubt that pepper spray would be considered a proportionate use of force, depending on the factual circumstances.

IANAL or anything legal but weren’t there some cases of people recklessly or perhaps on purpose trying to infect partners with HIV, a few years ago.
That could provide precedent, it seems.