they use antennas with a special amplifiers to detect electrical field changes caused by lightning strikes. Since they know where these antennas are they're able to triangulate the lightning strikes using the time delta between stations.
If you setup a lot of microphones to pickup gunshot sounds, you should be able to triangulate them as well. I would guess that you would need many more stations though, since acoustic signals don't propagate as well electrical signals.