Pretty much have to allow a bear to get about 10 feet from you in order to effectively use bear spray, and you had better be sure it’s not a windy day. Good luck.
I'll provide the wind. First I'll try to choke him to death with heel dust. Second I'll spray bear spray behind me with my special propellant. As a last resort, I'll respond with violence. Watching old Bruce Lee movies, I have a special maneuver in mind he won't see coming.