A firearm won't prevent an attack by bears etc simply carrying it. A warning shot sometimes/most will cause them to turn tail. It does give you the option of trying to kill the critter and prevent your own demise. Contrary to what the ASPCA or whoever says a first shot will get the animal's attention if not drop him on the spot. A .22 won't on a half ton animal or at least I won't find out.
A firearm in sight will definately give second and third thoughts to two legged predators. If it a committed attack then you can drop them before they harm you. It is not rocket science to use a firearm nor is common sense. Many including the media have convinced many that you're more likely to be hurt if you have a firearm and have scared many many to the point that they are afraid of anything looking like a firearm.
Make your own decisions, about it but no one is going, to pop out, of the woodwork, most times to save you and so on.