It does. When spray is deployed correctly it will stop a fully committed charge
or it will make the bear abandon the attack even if they come in contact with you as a result of momentum.
If they get a face full of the stuff - they're out of the fight.
Take this video for example (warning - this guy died as a result), the bear is in full attack mode and the spray is the only thing that stops him. https://www.youtube.com/watch?v=_ePoeP43wyk