It definitely varies from state to state. In my homestate of Louisiana you'd be legally justified to kill in that situation. What state do you live in?

Some good sites to read about the various laws:
http://www.gunlaws.com/
nra.org