If the grizzly is already charging you, you’re probably dead no matter what you do. You’ll have slightly better chances with the pepper spray than with a gun, but you’re still pretty much screwed. The smart idea is to never get into that situation in the first place.
It’s a crap shoot. There have been stories of bears rolling in the stuff much like a dog does. About the only thing one can do is to drop to the ground, curl in a ball, and try to protect the back of his neck. But bear attacks are rare. I lived in Alaska for a total of 30 years and never had a bear encounter other than at Katmai National Park, but then that’s the reason people go there.