If it comes down to a choice I'll choose my pistol every time. You are likely to get sprayed or blowback from bear spray depending on the wind and if it's not effective on the bear your in trouble.
For me it’s weather dependent. Here on Kodiak Island when it is windy (70% of the time) bear spray is useless. Body language in my opinion is the best grizzly deterrent. That being said i still usually carry bear spray for the sole reason of if i do shoot the bear it will look better on paper to say i tried a non lethal deterrent before i shot a bear in self defense. In my experience if you shoot a bear in self defense you better have your story straight because they will go after you.