A simple form of protection uses high-energy, transient-clamping devices placed in parallel across the AC power source. When presented with instantaneous voltages higher than a certain value, they behave like a short circuit and clip transient spikes down to a value equal to the device's clamping voltage. The metal oxide varistor (MOV) is one such device. A pair of zener diodes in series, back to back, is another. Different clamping voltages and joule ratings are offered, so you need to buy a device with a joule rating greater than the clamping voltage times the expected transient current times its duration. Clamping cannot be achieved by the device alone. It is done by the voltage divider action of the internal impedance of the power supply and the incremental impedance of the clamping device when conducting.
You will sometimes see the ashes of such devices that have received excessive joules due to the low impedance of the AC power source. You can choose a higher joule rating, or you can increase the source impedance by addition of a series inductor.