Revenge and prevention are two separate things. You have no right to 'shoot back' at somebody who is shooting at you, only to eliminate the threat. If you can eliminate the threat by shooting, good for you. If you can't, you have zero justification to shoot.