It's the widely recognized Principle of Self-Defense. If you believe you are in imminent (not immediate, but imminent) danger of serious bodily harm or death, you are entitled to use Deadly Force. On a number of documented occasions, people who carry firearms, myself among them, have been able to stop an attack simply by displaying the firearm. Just because you draw your pistol doesn't mean you're going to discharge it.
Your assumption the "bum" is "unarmed" is just an assumption. Many homeless/street dwellers carry knives for their own self-defense against the maggots who prey upon them.
Your solution of "Learn to fight and if you're small/lazy: pepperspray/taser" isn't applicable to a number of people who are unable to access pepper spray and/or a taser. Not bad alternatives, but suggesting one needs to learn to fight to protect oneself against spontaneous assaults from "bums" is a bit juvenile. Firearms are the Great Equalizer. Buy a pistol, learn how to use it, and get a concealed carry permit if available and you're good to go.