Never shot one...but...
About 5 years ago myself and a colleague were bluff charged by a sow black bear 6 or 7 times in the same encounter, juiour was up a tree. No gun, no pepper spray. She stopped charging at us when we were finally far enough away from the tree with the cub in it.
Last August myself and 4 colleagues were working around a small wetland inside typical northern Ab. boreal forest. I heard a weird scratching sound, myself and one of the other guys looked at each other with a puzzled look on our faces...then he says "cubs"...theres two cubs hurrying up a tree about 20 yards away. A few seconds later I could hear hissing and a general "I'm a PO'ed bear noise"...None of us ended up seeing the sow...but she was dang close. We all had pepper spray, and backed out to a cutline about 35 yards in the opposite direction and picked a new location for the work day.
Moral of those stories is that hair raising bear encounters aren't always unavoidable. Things happen quick even with experienced people.
In October of 2010 I played a fun game of using gun fire to encourage a boar grizzly to keep his distance from me. The best part was the last 20 minutes or so of the game took place in the dark as I was making my way back to the truck. When I first realized that his path was going to take him right into my lap I stood up and waved at him (he was 100 yards away at this point)...this tactic has made alot of bears run away. All this guy did was look at me and keep walking towards me. At 30 yards I fired a round into the dirt in front of his face. This put distance between us. So I gather my things and headed for the truck. Some more gunfire and raised blood pressure but it eventually ended well for both of us.
Just this past fall, I had my crosshairs on a tank of black bear boar in an oatfield at 7 yards. I was trying to intercept feeding elk on their way back to cover when yogi and I crossed paths. He stood up to have a look at me so I said "hey" in a somewhat muttered tone (didn't want the elk to get to wound up

) then I put the crosshairs on him but he did what was expected and bolted in the other direction.
I have a handful of other black bear stories, two whch involve pepper spray being used..but the ones above are the most interesting.
Long story short...having a firearm and knowing how to use it is comforting in bear country.