A spark gap consists of an arrangement of two conducting electrodes separated by a gap usually filled with a gas such as air, designed to allow an electric spark to pass between the conductors. When the potential difference between the conductors exceeds the breakdown voltage of the gas within the gap, a spark forms, ionizing the gas and drastically reducing its electrical resistance. An electric current then flows until the path of ionized gas is broken or the current reduces below a minimum value called the "holding current". This usually happens when the voltage drops, but in some cases occurs when the heated gas rises, stretching out and then breaking the filament of ionized gas. Usually, the action of ionizing the gas is violent and disruptive, often leading to sound (ranging from a snap for a spark plug to thunder for a lightning discharge), light and heat.
Spark gaps were used historically in early electrical equipment, such as spark gap radio transmitters, electrostatic machines, and X-ray machines. Their most widespread use today is in spark plugs to ignite the fuel in internal combustion engines, but they are also used in lightning arresters and other devices to protect electrical equipment from high-voltage transients.
For air, the breakdown strength is about 30 kV/cm at sea level.
The light emitted by a spark does not come from the current of electrons itself, but from the material medium fluorescing in response to collisions from the electrons. When electrons collide with molecules of air in the gap, they excite their orbital electrons to higher energy levels. When these excited electrons fall back to their original energy levels, they emit energy as light. It is impossible for a visible spark to form in a vacuum. Without intervening matter capable of electromagnetic transitions, the spark will be invisible (see vacuum arc).
Spark gaps are essential to the functioning of a number of electronic devices.
A spark plug uses a spark gap to initiate combustion. The heat of the ionization trail, but more importantly, UV radiation and hot free electrons (both cause the formation of reactive free radicals) ignite a fuel-air mixture inside an internal combustion engine, or a burner in a furnace, oven, or stove. The more UV radiation is produced and successfully spread into the combustion chamber, the further the combustion process proceeds.
The Space Shuttle Main Engine hydrogen oxygen propellant mixture was ignited with a spark igniter.
See also: Surge protector
Spark gaps are frequently used to prevent voltage surges from damaging equipment. Spark gaps are used in high-voltage switches, large power transformers, in power plants and electrical substations. Such switches are constructed with a large, remote-operated switching blade with a hinge as one contact and two leaf springs holding the other end as second contact. If the blade is opened, a spark may keep the connection between blade and spring conducting. The spark ionizes the air, which becomes conductive and allows an arc to form, which sustains ionization and hence conduction. A Jacob's ladder on top of the switch will cause the arc to rise and eventually extinguish. One might also find small Jacob's ladders mounted on top of ceramic insulators of high-voltage pylons. These are sometimes called horn gaps. If a spark should ever manage to jump over the insulator and give rise to an arc, it will be extinguished.
Smaller spark gaps are often used to protect sensitive electrical or electronic equipment from high-voltage surges. In sophisticated versions of these devices (called gas tube arresters), a small spark gap breaks down during an abnormal voltage surge, safely shunting the surge to ground and thereby protecting the equipment. These devices are commonly used for telephone lines as they enter a building; the spark gaps help protect the building and internal telephone circuits from the effects of lightning strikes. Less sophisticated (and much less expensive) spark gaps are made using modified ceramic capacitors; in these devices, the spark gap is simply an air gap sawn between the two lead wires that connect the capacitor to the circuit. A voltage surge causes a spark that jumps from lead wire to lead wire across the gap left by the sawing process. These low-cost devices are often used to prevent damaging arcs between the elements of the electron gun(s) within a cathode ray tube (CRT).
Small spark gaps are very common in telephone switchboards, as the long phone cables are very susceptible to induced surges from lightning strikes. Larger spark gaps are used to protect power lines.
Spark gaps are sometimes implemented on Printed Circuit Boards in electronics products using two closely spaced exposed PCB traces. This is an effectively zero cost method of adding crude over-voltage protection to electronics products.
Transils and trisils are the solid-state alternatives to spark gaps for lower-power applications. Neon bulbs are also used for this purpose.
A triggered spark gap in an air-gap flash is used to produce photographic light flashes in the sub-microsecond domain.
Main article: Spark-gap transmitter
A spark radiates energy throughout the electromagnetic spectrum. Nowadays, this is usually regarded as illegal radio frequency interference and is suppressed, but in the early days of radio communications (1880–1920), this was the means by which radio signals were transmitted, in the unmodulated spark-gap transmitter. Many radio spark gaps include cooling devices, such as the rotary gap and heat sinks, since the spark gap becomes quite hot under continuous use at high power.
A calibrated spherical spark gap will break down at a highly repeatable voltage, when corrected for air pressure, humidity and temperature. A gap between two spheres can provide a voltage measurement without any electronics or voltage dividers, to an accuracy of about 3%. A spark gap can be used to measure high voltage AC, DC, or pulses, but for very short pulses, an ultraviolet light source or radioactive source may be put on one of the terminals to provide a source of electrons.
Spark gaps may be used as electrical switches because they have two states with significantly different electrical resistance. Resistance between the electrodes may be as high as 1012 ohms when the electrodes are separated by gas or vacuum which means that little current flows even when a high voltage exists between the electrodes. Resistance drops as low as a 10-3 ohms low when the electrodes are connected by plasma which means that power dissipation is low even at high current. This combination of properties has led to the use of spark gaps as electrical switches in pulsed power applications where energy is stored at high voltage in a capacitor and then discharged at high current. Examples include pulsed lasers, railguns, Marx generators, fusion, ultrastrong pulsed magnetic field research, and nuclear bomb triggering.
When a spark gap consists of only two electrodes separated by gas, the transition between the non-conducting and conducting states is governed by Paschen's law. At typical pressure and electrode distance combinations, Paschen's law says that Townsend discharge will fill the gap between the electrodes with conductive plasma whenever the ratio of the electric field strength to the pressure exceeds a constant value determined by the composition of the gas. The speed with which pressure can be reduced is limited by choked flow, while increasing the electric field in a capacitor discharge circuit is limited by the capacitance in the circuit and the current available for charging the capacitance. These limitations on the speed with which discharge may be initiated mean that spark gaps with two electrodes typically have high jitter. 
Triggered spark gaps are a class of devices with some additional means of triggering to achieve low jitter. Most commonly, this is a third electrode, as in a trigatron. The voltage of the trigger electrode can be changed quickly because the capacitance between it and the other electrodes is small. In a triggered spark gap, gas pressure is optimized to minimize jitter while also avoiding unintentional triggering. Triggered spark gaps are made in permanently sealed versions with limited voltage range and in user-pressurized versions with voltage range proportional to the available pressure range. Triggered spark gaps share many similarities with other gas-filled tubes such as thyratrons, krytrons, ignitrons, and crossatrons.
Triggered vacuum gaps, or sprytrons, resemble triggered spark gaps both in appearance and construction but rely on a different operating principle. A triggered vacuum gap consists of three electrodes in an airtight glass or ceramic envelope that has been evacuated. This means that, unlike a triggered spark gap, a triggered vacuum gap operates in the parameter space to the left of the Paschen minimum where breakdown is promoted by increasing pressure. Current between the electrodes is limited to a small value by field emission in the non-conducting state. Breakdown is initiated by rapidly evaporating material from a trigger electrode or an adjacent resistive coating. Once the vacuum arc is initiated, a triggered vacuum gap is filled with conductive plasma as in any other spark gap. A triggered vacuum gap has a larger operating voltage range than a sealed triggered spark gap because Paschen curves are much steeper to the left of the Paschen minimum than at higher pressures. Triggered vacuum gaps are also rad hard because in the non-conducting state they do not contain any gas that could be ionized by radiation. 
Main article: Bug zapper
They are also used as insect zappers. The two electrodes are implemented as metal lattices placed a slightly too far apart for the voltage to jump. When an insect ventures between the electrodes the gap distance is reduced by the insects body, being conductive, and a spark discharge occurs to electrocute and burn the insect.
In this use the spark gap mechanism is often used in conjunction with a bait, such as a light, to attract the insect into the spark gap.
Jacob's Ladder videos: