I have seen bear spray be effective. But like any tool it can also fail or under perform at the moment of truth. So it is best not to count on any one thing.
is using several layers of defense starting with the right mindset and precautions to minimize risk of having to use one of the multiple tools carried. It's great to hear.
I have been arms reach from a bear during daylight because neighboring campers insisted on leaving their big batch of kool aid out every time they left the site for a whle. Although this was very poor practice on their part it didn't call for alarm or bear spray...
Being noisy and clapping was enough to shoo the bear away. Bears in general are usually more curious than aggressive. And like most animals see humans as something to be avoided. Even though they are a powerful omnivoric predator, evolution dictates that they conserve energy for survival. So they are not looking for a fight...unless sweet, sweet kool aid is involved.
Then it's a close call.
But making an uncomfortable, unfamiliar environment for them will usually tip the scale...bear spray is really just an escalated step of that.
If an adult bear is fully committed to an attack a spray is probably not going to stop it. But a whole series of mistakes have to be made before that is likely.
RE: What's in my hiking backpack, (go bag)?