A reader writes:
I've read that the problem with ray guns is that as an energy delivery system, pieces of high-speed lead propelled by a chemical reaction work much better than photons propelled by battery power.
If you could dump all of the energy out of, say, a AA battery really fast, though, could you get bullet levels of energy out of each battery?
Yes, you could.
Let's presume you're using nickel-metal-hydride AA batteries, which are somewhere between average-rifle-cartridge and average-pistol-cartridge in size. You can get a lot more current out of a NiMH or NiCd rechargeable than an alkaline or carbon-zinc battery, but, as you say, you still can't discharge them nearly fast enough for them to be useful replacements for firearm cartridges.
Even if you don't care whether the battery survives the experience, the biggest bang you can get out of a battery is the feeble "explosion" of a laptop battery. That may give you nasty burns if it happens literally on your lap, and shorted batteries have been responsible for the destruction of quite a few cargo planes, but batteries are no more than firecrackers compared with proper explosive devices.
Never mind that for now, though, let's just look at the energy content.
The most generally useful kind of NiMH cell is the "low self-discharge" type, which unlike the older kind of NiMH, do not go flat in a matter of weeks whether you use them or not. (Low-self-discharge cells are often sold as "pre-charged", or "ready to use".) LSD cells have lower capacity, though, so let's say we're using non-LSD cells with the absolute bleeding edge maximum capacity today available, which is about three amp-hours (3000 milliamp-hours).
Firearm muzzle energy is often measured in foot-pounds, not joules, but I'll keep it all in SI units here. You also couldn't get the entire capacity of any electrical energy source into your beam or projectile, because no laser or mass-driver is 100% efficient, but I'll handwave that as well.
12,960 joules is a pretty darn respectable chunk of energy, way more than any handgun cartridge can manage. 9mm rounds top out around 500 joules of muzzle energy, .44 Magnum is a couple of thousand joules at most, and even the ludicrous .500 S&W Magnum is only around 4000 joules.
Rifle cartridges that qualify as "high-powered" seldom exceed 4000 joules. You have to start looking at exotic specialised sniper and large-game rounds, or heavy-machine-gun ammunition, before you get above ten thousand joules. The .50 BMG round easily beats 12,000 joules, and the more ludicrous kinds of elephant-gun double rifle roughly equal the battery's energy...
...as you'd bleeding well want them to, for this kind of recoil punishment.
But all of this is, again, just fantasy, because you can't dump the energy out of any kind of battery anywhere near fast enough to make it useful in a gun.
You can, however, dump the energy out of a capacitor in a very short period of time.
The highest-capacity "supercapacitors" can't be discharged in a tiny fraction of a second without damaging them; they're usable in a flashlight or for regenerative braking, but not for one lightning-strike discharge, as in a firearm.
Normal caps certainly can be discharged fast, though.
This cap bank could be used to power some kind of kinetic or ray-gun weapon - but it takes all of those huge beer-can capacitors to hold a mere 11.3 kilojoules, roughly the same as our one AA NiMH cell. The one killing the watermelon above is only 9270 joules, and its caps are huge.
I have one beer-can electrolytic cap of my own; it featured in this...
If it still had its full original capacity - which it doesn't - then fully charged to its 850-microfarad, 450-volt redline, it would hold 86 joules of energy.
The miserable performance-per-size of electricity-storing devices is why electromagnetic railguns are of moderate interest to navies...
...but not to armies.
Chemical lasers can be usefully powerful without requiring capacitor banks the size of a house. They are generally very unpleasant to be near, though, because they either run on, or produce, horrible toxic compounds.
Oh - and if you've never watched Kaboom!, you really ought to.
UPDATE: On the subject of ludicrous electrical things, there's this piece I did on what a AAA battery composed of nothing but electrons would be like.
(It would not be kind to nearby spacetime.)
And then commenters will, I hope, correct at least the most obvious flaws in my answer.