first thing:
you need to find out what the local laws are regarding protection of your livestock... in most places where you can have livestock, you are within your rights to protect them by whatever means necessary, including shooting the attacking animal. in those circumstances, there are no consequences for you if you do so.
however... there are some areas where it's not legally allowed, even if they're killing your animals. even in those areas, the Three-S rule may apply (shoot, shovel, shut up) but you need to know what the potential legal issues are before you do that. if your local laws don't permit shooting in defense of livestock, you need to know what risk you're taking by doing so.
where I live now in MO, no one would think twice about shooting attacking animals. where I moved from in SoCal, doing so would bring you *big* legal trouble if it was reported... starting with a visit from the SWAT team and a trip to jail.
second thing:
gun. have one, carry it with you when checking out the bark alarm. and you need to practice shooting it in that environment... if it was dark enough to need a flashlight just to see the dog's eyes, how are you going to shoot them without a light? if it's a handgun, you can hold the flashlight in your left (lightbulb end at the little finger side) and brace your right shooting hand on your left forearm... that way you can shoot where the light shines. would be good to practice this in advance, especially if you're not used to one-handed shooting. unless your property is so big, or so happily situated, that you don't have to worry about a bullet getting off your property, you need to know what's down range of what you're shooting. and you need to be sure you're hitting what you aim at. inside the pen you have a good chance of making this happen before they're out of range. if you're shooting a rifle, you need to think about how you're going to light the place so you can see to shoot - you really do want to know the bullets are going into the attacker, not somewhere a mile away.
other things:
they will be back, you need to get animals put up securely until this is resolved.
you may want to look at LGD, they will deter most of this sort of activity and can kill most dogs that would try this with them there. donkeys, llamas etc, are used as protectors but where you've got a known problem with dogs capable of killing good sized livestock, I think you need something with sharper teeth.
sorry to hear about your loss. it was a big financial loss, in addition to an emotional one. I hope you find the dogs, and their owners, and that they have the money to make compensation possible.