The ethics of discussion are fascination. OP, you opened a can of worms, and I think I like it.
Personally, I think my reaction is based on a series of priorities:
1) Is my family safe? This has to be my top priority, and any action I take must be to help achieve this goal.
2) Am I safe? Once my loved ones are reasonably safe, I have to decide if i think I have a reasonable expectation of surviving unharmed. Do I have cover? Do I have a shot where I can remain out of the shooters line of fire? Do I have sufficient firepower and ammunition to reasonably expect success?
3) Will I help more than hurt? Will my engaging in the situation will do more harm than good? Do I have a clear shot, and do I know what my target is and what is beyond it?
If I can't address all three satisfactorily, then my best option is to escape the situation if I am able.
Actual results may vary.