God has hardwired self defense and the strong will to live in all of His creation, from the smallest creature right up to us, and as such it is right and good to preserve and protect life. Guns save innocent lives many times every day; and self-defense is not "living by the sword", it is criminals that live by the sword.
If my wife is being raped or violently mugged by some thug, my duty is to protect and try to save her, even if it costs me my life. Any praying I would be doing would be that my wife comes out unharmed.
"Whosoever shall seek to save his life shall lose it; and whosoever shall lose his life shall preserve it". This says to me that praying for, instead of helping a victim is an act of cowardice, an act that says, "this is a dangerous situation that might get me hurt, so you take care of it, God!"So doing nothing but praying is an attempt to save your own life.............pass the buck to God because you might get hurt.
So, as in the passage in James, praying for, or bidding well to someone does nothing if you don't actually do anything about it!
15 Suppose a brother or a sister is without clothes and daily food. 16 If one of you says to them, “Go in peace; keep warm and well fed,” but does nothing about their physical needs, what good is it? 17 In the same way, faith by itself, if it is not accompanied by action, is dead.
Using a gun to protect and save the innocent is better than doing nothing but saying, "be thou protected" and walking away.