As far as I know, current thinking is to stand your ground during a charge (which may well be a bluff) unless you're actually contacted. If it's a grizzly, many times they simply seem to want to eliminate a threat, so playing dead is your option - it's highly unlikely you could discourage a grizzly by fighting. If a black bear has been stalking you and appears to have predatory intent, and it contacts you, fight back. Rules of thumb only, from joint work done by Alaska, Yukon, B.C. bear biologists. Resulting videos are "Staying Safe in Bear Country" and "Working in Bear Country".
Bear spray works pretty well. I don't think sprayed or not is going to change what a bear does if it manages to continue the attack...and there is also some evidence that "looking big and tough" may deter a threat. Being Canadian, we say to "hold a hockey stick over your head" which gives you a bigger profile, that's the idea. Groups are less likely to be attacked than individuals, again a larger profile. Wild animals live a risky life, so have to do a cost benefit analysis of actions - is it going to hurt me, or is it worth it? Mothers with cubs aside, who have a different motive...and like people, I've met biologists who claim to have observed 'crazy bears' - they are individuals.
The chances of meeting a bear is pretty remote, even here. At certain times of year and location, I could probably take you places where you are likely to see a bear, but most of the year they're scarce. Lucky to see one. When you do meet one, 98% of the time it's going to move on, ignore you, or at most, want you to carefully move out of it's territory.
It's one of those "what's the real danger" things. My weather trivia calendar says that lightning kills more people in the U.S. annually than hurricanes and tornadoes combined, but what gets the big press?