A lot of people will tell you that in a situation like this it is better to run away than to fight, this however is probably the worst thing you could do because if the assailent is armed with a gun (or even a knife) they are almost alway going to be able to get you with the weapon before you are a safe distance away, you should attempt to dissarm or disable them, your chases of survival rise significantly, particularly if you can surprise them somehow.