Bear sprays are meant to put out a cloud of spray that the bear (or other beasty) inhales as well as getting it in its eyes.
It is the effect on their eyes and their breathing that is the deterrent. They are suddenly unable to breath properly or see.
The idea is to put that cloud out there that the bear has to come through as it charges. It is not like you are actually trying to spray the bear as a target.

Bear sprays are meant to put up that cloud about 25 feet from you and are really meant to be used if the bear is charging at you.

Sprays are effective in most cases, but even then back ups might be needed. Not every bear is stopped by spray.

About seeing the bear first? Well, that is not always true either.
Bears are very good at moving through thick brush quietly, but very seldom has anybody been stalked as prey by a bear. It has happened a few times though, and the stories told by survivors are illuminating. In several of them they had no idea there was a bear there until they had already been knocked down.

I don't want to make it sound like the bears, cougars and wolfs are all just waiting for you to step off the sidewalk so they can satisfy a ravenous craving for human flesh.
It is not like that at all.

You are far more likely to stumble over a sleeping bear, get between a sow and her cubs or surprise a bear that is just not paying attention. It does seem odd that an animal with such fine senses could be surprised but they get careless at times too.

Hikers wearing bells and survey crews on salmon streams using air horns have still managed to surprise bears at short range.
These types of encounters often result in the bear charging because it does not know what else to do.

I often go into fairly remote areas with no gun or spray.
However, in areas where I know I will be close to bears, especially bears that are more habituated to people, I take equipment that might be needed to prevent becoming a casualty.
Yes dumps qualify, so do public camp grounds, bear habitat areas like the edges of swamps and at certain times large berry picking areas.

Black bears have been killed by people hitting them with sticks, but like Tom_L points out, that is really a last ditch effort.


To comment about survival situations I would say Susan has it right.
I would add that any encounter with a bear is automatically a survival situation.
It does not mater if it is in the deep dark forest or on your own front porch.
_________________________
May set off to explore without any sense of direction or how to return.