I carried a gun as back up to bear sparay. When I was in the places where I might happen to meet up with an agressive bear.
I would use the spray first. Better chances of not only a hit, but of the bear leaving as well. The gun would be for the event of running into another bear on the way out.
No matter how many times you do it and nothing happens it only takes something going wrong one time to kill you.