TallZXDriver's got it right on - acting before you know the full situation is folly...having said that, i'll also say that the situation as presented, lone gunman knocking over a convenience store and you're behind with a CCW - it's a shoot scenario. in fact, as presented, in my state and jurisdiction, it's a no brainer shoot scenario. it's textbook in it's simplicity, complicated in the act, and messy at the end. ain't law fun?
but, some caveats first: in my jurisdiction, IT DOES NOT MATTER if it's an airsoft gun, a hand in the pocket, a bb gun, a knife, whatever. the presence of a weapon being used in an offensive manner constitutes a valid threat. anyway, rarely do things happen so slowly that you are able to see the make and model. assuming a number of things, such as the following: you still have manual dexterity (fine motor skills are not really great in high stress environments, unless and sometimes even if trained to deal with these types of things) and a clear shot, have time to line the shot up instead of spraying, etc., you have a number of options. situational awareness CANNOT be overstated here - knowing what and where, how, how many, etc., is of the utmost importance. warning shots are not authorized. warnings other than identifying myself as a LEO will probably not be given. there will be no repeated pleas to drop the weapon, and if it turns towards me or things begin to snowball, three things: firm grip, front sight, 5 pounds of pressure.
the defense of others is rarely going to be a murder setup; not murder, perhaps manslaughter of whatever degree depending on jurisdiction, and when unwisely performed. you can count on that firearm being confiscated by the police for all sorts of reasons. it is much wiser to observe with gun in hand, or even to call 911 and leave the phone open - the call is recorded, and there's at least some evidence should something go awry.
now - what i would do is somewhat different then non LEO types. most departments have a rule set up like this: "when possible, identify yourself as a law enforcement officer before using deadly force." sounds reasonable, right? that can be spat out VERY quickly, and by that point, i'm locating front sight post on center mass or head if close enough. turning to face me involves NOT immediately shooting the clerk, and "BANG!" repeat as necessary until the threat is stopped. since i'd dialed 911 and set the phone down, cops should be enroute and both hands are free. *IF* i've managed to end this encounter without myself or the clerk injured, lock down the area, no movement in or out, touching as little as possible, as it's now a crime scene and things need to be done. attend to the clerk, who's probably shaken up pretty well. assess the condition of the perp. if alive, assure disarmed and no threat. *THEN* pick up the phone or call back, identify, and feed information to dispatch to responding units can take appropriate action. stay on the line with dispatch until responding units are on scene to prevent misidentification and minimize confusion. comply completely with orders from that point on.
there is one thing i think should be cleared up - the stigma that good guys don't shoot bad guys in the back is not reality. if he poses a deadly threat to you or someone else, he should be painted red. there is no loss of face for shooting someone from behind to save another life. good guys don't always wear white hats either...SCOTUS preserves the idea that defense of a third party is cause for, and grounds to use, deadly force.
you MAY wind up on the wrong end of a civil suit, but i can't reasonably see criminal charges being filed by competant LEOs using the situation above. but again, i stress the importance of knowing what's going on around me, thinking as i go, and knowing what my options are. focusing on the phone is very bad - focusing on "number one first" is not acceptable, and focusing on what may happen to you afterwards is out of the question. if you're there mentally, you've lost the fight already, along with potentially your life and that of the clerk or other bystanders. but this post is written by a LEO...