I'll still maintain the worst gun is still much better than the best martial art, unless, as KLRANGL said, the attacker is in just the right place.
Also, the mindset of the martial artist MUST be to destroy. They must stop the threat long enough to get out of range. That means kicking testicles, gouging eyes, chopping the throat, and breaking bones (over and over if need be). It's an all-or-nothing deal. If you decide to fight, it's all the way. Keep in mind, if you make one mistake, miss one punch, or hesitate a split second, you're dead.
Martial arts MAY get you out of a situation when the BG is unarmed. If the BG IS armed, the chances go down exponentially with the level of weapon.
Remember the scene in Indiana Jones in the town square? The BG swinging that sword all around, obviously an expert with it. Indy takes one look and simply draws and shoots the guy from 20 feet away. Now I know movies aren't even a bad representation of real life, but I can see this scene going down for real in a dark alley.
I'll repeat, never bring a fist to a gun fight.