The reality is it's variable.  Bear spray did not help in the Pogo attack where it was deployed.  Guns present their own problems when defending another person.  With the bear on the mauling victims, they could be hit by a bullet unless the shooter has damned sure aim.  So spray was definitely the better thing here, but if it hadn't worked a gun would have been handy to have as a last resort.  

That's the problem.  Each attack is different and there's no one solution.  Grizzlies and black bears have differing behavioral patterns.  Some attacks are defensive, others predatory.  And each individual bear has its own quirks, just like all other animals.  What works for one can fail with another.  It's not predictable and it happens with horrific speed.  

People who insist that there is only one viable choice, be it guns or spray, are both proven wrong by the history of attacks.  There's more than a little logic to carrying both.