I've wondered about how effective bear spray is in the rain or against the wind. It would tough for me to decide whether to reach for spray or firearm when you only have a second or two decision time. As I already mentioned a dog would be a good alarm. I don't expect one to stop or really slow a bear much but one could give a few moments warning that something was up. The real fact is that if a bear jumps you suddenly, close and unnoticed there isn't a hell of a lot one could do anyway.
Don't believe in warning shots.
I gave a bear a warning shot: No impact! (pun intended), but didn't shoot the bear since while the bruin was uncomfortably close, was not closing in.
I distinctly remember feeling that now I've blown 1/6th of my 44 ammo and only have five shots left in the dark within a canopy of trees under a cloudy moonless night. My speed loader was some where in the tent, by the boots.
I went back in our tent, trying to sleep: so it all got quiet, now I heard my wife's heart beat thus realizing under her calm demeanor was one heck of a scared pretty girl.
At early dawn, when the bears returned, I felt much better, more sober, and could at least take good front sight aim on a moving dangerous sentient being.
Since then, I bring a 44 carbine (or a slug pump) into the remote woods, with a flash light lashed to the barrel: A real comforting stick to have while sleeping softly.
Pepper sprays are a nice ideal, if I have another pair of calm hands to deploy, but most of life's troubles are solved by judicious use of cash or sturdy bullets, including having the courage not to, when that's right.