Driving relay and solenoid coils safelyCoils are inductors. It is in the nature of an inductor to oppose any change in current by generating an opposing voltage. In your car, when the ignition contacts interrupt the current through the ignition coil, the coil tries to keep the current flowing by generating a voltage so great that a big fat spark results. In a relay or solenoid coil the same thing may happen, and the resulting spark can trash the transistor that is driving it. With a coil driven off DC the fix is to place a diode across the coil with the cathode to the positive end of the coil.
AC coils are more complex. Inductance resists a change in current but with AC the current is changing all the time. Hence the more inductance the less AC current. Here's the kicker: The inductance of an AC relay coil depends on the position of the moving armature. When the relay is open the inductance is much lower than when closed. Hence, an open AC relay draws more AC current that a closed AC relay (or solenoid). Thus AC relays have an inrush current that must be allowed for in the driver design. AC relays may also generate a high voltage at turn-off, but you can't use a diode to suppress it. Instead you must use an RC snubber. Don't use a MOV - MOVs are not designed to take continuous hits.
In AC relays the inductance limits the current. In DC relays the coil resistance limits the current. AC relay coils have very little resistance compared to DC relays of the same voltage rating. Hence, if you drive an AC coil with DC, the current will be many times more than expected; smoke will come out.