Right.. It's most-likely an inductor. Inductors "try" to keep the currrent through them constant. (Capacitors "try" to keep voltage across them constant.) When you break the circuit, the magnetic field around the inductor collapses and that keeps current flowing (for a short period of time, depending on the inductance). If you suddenly have infinite resistance, infinite voltage is required to mantain the current. Of course you can't get infinite voltage, but the voltage can spike high enough to break-down the air molecules (which means you no longer have infinite resistance) and you get a spark. It's the same way your ignition coil sends high-voltage to the spark plugs.
Or, if you have a high resistance (such as the resistance through your body) you can get dangerous voltages (and dangerous current) through your body.