I feel the need to post this again.. this is directly from Dept of Defense guidance on dealing with active shooters. It is based on extensive study of historical events.
1. Evacuate, if possible.
2. Hide out. Barricade yourself in a secure area with only one entry point. Call 9-1-1, wait for responders. Provide as much detail as possible regarding the number of shooters, their demographics, their locations, and their weapons, and any injuries on the scene.
3. Take action as a last resort. Active shooters are rarely determined fighters and direct, aggressive action can end a situation quickly. Use whatever items are available as weapons.
If the other guy has his gun out, you're already behind the curve. If you can get to cover (not just concealment) it means you can re-center yourself and develop a plan for evaculation (the safest options) or fire to stop the threat. Just a few extra seconds to steady yourself could mean the difference.