I slept at a Holiday Inn last night and believe you are allowed to retaliate with the same force that the "victim" would be permitted, under the law. So, know what those laws are, properly interpret the situation (like, it's not the cashier's friend playing a prank), and act accordingly. Fact is, even if he's playing a prank, and you react within the boundaries of the law, you'd still be ok. Now, let's define ok.
Geography will play a huge part in how this plays out, but here goes:
In our justice system, you are presumed innocent until proven guilty.
When someone is shot to death, it's presumed murder, until proven otherwise (perhaps not officially, but that's how most LEOs operate. And I'm not knocking them for it).
The fact is, there's a dead body and someone will have to answer for that. In this scenario, it's you. You murdered this man and the police and the DA will want to know why, as will his family, but we'll get to that later.
So, a young officer shows up, anxious to get his first collar, and he asks you what happened? You say, this guy came in with a gun, threatened the cashier and I shot him. "click" the cuffs are on and the odyssey begins. Hopefully, the DA and the police (video tape) agree with your version. And they both must agree. Of course, by this time, you might/should already have contacted your lawyer. In fact, the best answer to the officer's question is: this guy came in with a gun, threatened the cashier and now he's dead. Officer: "Well, who shot him?" You: "I'd like to call my lawyer."
Assuming you make it through the legal gauntlet, that's when the fun really begins. See, the guy you justifiably shot, had a family and their primary form of support is laying in the morgue, someone will have to answer for that. In civil court, the rules are much different and you could find yourself on the wrong end of that. Heck, the "victim" could have been the guy's wife and they planned the robbery together, but you messed it up by killing him.
No, I don't write crime novels, but the fact is that once you discharge a firearm, right or wrong, you could spend $75,000 or more digging your way out of that mess. I don't care if you shot the guy in your bedroom. With the wrong DA, and our civil court system, you could be in a world of hurt.
For me:
Plan A - evade and escape whenever possible.
Only fire when there is absolutely no other alternative to protect myself or others. YMMV