While Cammalu's post is correct, if you have a person coming at you and are in fear of your life, you are NOT going to be arrested for using bee spray on them.
Force Majure applies when lives are in danger.
Use of any communication device is legal (even a ham radio without a license) "stealing" someone elses boat, car, van, truck...breaking into a remote cabin, whatever. If lives are in danger, DO IT. Don't be a victim.
That 20 feet spray stream is NOT nice in the face and will at least delay most people.
Pretty damned good idea and available cheap in any store.
"I will spray you if you come closer" before letting it loose, pretty much covers anyone being assaulted from liability.
A road rage dispute between two big guys ended in prosecution because one of them hit the other with bear spray.
Witnesses saw a fair fight, with the loser choosing to spray the victor.
However, the EXACT same scenario between a woman in a minivan with children and a meth head type?? Not going to happen.
The key to it is, was your life in danger? The more logical that fact is to the LEO, the less chances of trouble.
(I'll take the court date in order not to drop a drunk with "lead spray" if possible, actually.)