Pepper spray was successful 94% of the time huh. What happened to the victims of the bear encounter in the other 6%? 6% of 500 incidents is about 30 failures, although we might assume that a few of these were brought about by the improper use of the product, and perhaps a few where the product did not function properly. It might also be reasonable to assume that the majority of pepper spray incidents occurred inside parks where the carrying of a firearm is prohibited, but where bears are conditioned to a human presence at certain times of the year.
The comparatively high failure rate with a firearm though perplexing could be attributed to many reasons. Insufficient training and poor marksmanship are high on the list, although they do not define the failures. A bear that is wounded and runs away was unable to carry through his attack, so it could be argued that such a situation was a success from the point of view of the individual who was attacked. If the carrying of pepper spray is common in parks, the carrying of a firearm throughout the rest of gun friendly Alaska is more common. The firearm could be carried in such a way that it could not be reached in time to prevent the attack. There could be ammunition failures. Shotgun shells standup poorly to wet conditions and should be changed out frequently, at least once a month. Primer failures are certainly not unheard of. There could be firearms that were in mechanically poor condition, or that were inappropriate for killing a large dangerous animal or that were loaded with inappropriate ammunition. Again shotguns seem to be the most egregious in this regard as people insist on loading them with shot rather than slugs in the mistaken belief that this practice improves the chances of hitting the target.
The major failing of pepper spray, next to the fact that it is non-lethal, is it's limited range. In order to be fully effective, the bear must be within 10 feet, never mind what it says on the can. When the bear is within 10 feet he is committed to a course of action. By contrast when armed with a firearm, a decision can be made concerning the bear's intentions, and deterrents (cracker shells or rubber bullets) can be applied at longer ranges, before the bear has made up his mind concerning what to do about you. If the bear closes to within 10 yards he can be killed at whatever point the shooter and the conditions determine as appropriate.
All of the foregoing assumes that an individual has some warning of the bear's presence, and has time to react. Such is not always the case. Attacks while sleeping are particularly frightening to consider, and under such conditions I would much prefer to rely on a big bore revolver than almost any other weapon or deterrent. If the bear stalks you for a predacious attack, only luck will save you. These guys are patient and very good at what they do, and it is unlikely they will give you the opportunity to respond in any way. Fortunately such attacks are rare.