Tragic and hair-raising experiences posted here.
When I lived in the Rockies, I enjoyed climbing fourteeners (peaks which are 14,000 feet ASL and higher). In order to avoid afternoon thunderstorms, I had to arrive at a trailhead well before dawn. It was surreal to hike in the dark, constantly scanning 360° around me with my headlamp while prepared to draw my .357 Magnum pistol. Thankfully, I never saw a pair of hungry eyes glowing at me.
Now that I live farther north, I carry bear spray, but as @KevinM mentioned, it is not foolproof. I whistle Mozart and various hymns while I hike or fish, and I carry a great, big revolver on my chest in case I encounter a bear that is not deterred by the announcement of my presence, or by a cloud of capsaicin.