I had a friend who was hiking the Appalachian Trail a few years back. I said I wouldn’t do it without my gun and he laughed and said I was paranoid. I would actually be more worried about wild animals than people, but in either case it’s good to be prepared.
Sorry, but a 9mm handgun isn't going to do much to deter an angry mama bear.