Well, you hiked an area with black bears for years, and "they are mean". So did one ever attempt to attack you? I live in black bear country and have had probably over 100 of encounters with them. I even had to wire the exterior of my house with a high voltage system to keep them from breaking in. The not infrequent damage they cause gets expensive fast. (In fact i now install systems on homes in the area as a business.) so i have plent of experience with black bears while hiking, hunting, working around my property, or just cooking dinner. Last encounter was 2 days ago while hiking. I kept my distance (about 70 yards, walked uphill around past them making sure there were no others in my path), and 1 watched me while the other ate…then they went the other direction.
Bears are not "mean". They are just bears. In the animal kingdom, that attribute is mostly exhibited by humans.
Black bears usually want nothing to do with humans. They generally do not prey on humans for food. I scare them away by making myself appear as large as possible and screaming at them. It can be scary if they suddenly appear. You have to stand your ground. Personally i have never had to spray one- i don't carry spray anyway. I've never had to shoot one either. I do carry when i go deeper into the wilderness alone. That is more for mountain lions than bears, but you never know. I had a mountain lion spying me at night at my camping spot when hunting last year. I jumped and screamed faster than i could draw my pistol and it bolted off like lightning. Glad that worked on the lion as well as it does on bears.
The main thing in staying safe with black bears is to not get between a mother and her cubs.
Brown bears are of course a completely different story. I have no experience with them and don't particularly want to.