A ballast resistor limits the amount of current flowing in an electrical circuit.
The most common automotive use for a ballast resistor is as to regulate the voltage to the ignition system by being inserted in series in the primary circuit between the ignition switch and the positive terminal of the ignition coil. It is usually located in the open near the ignition coil so that it can dissipate its heat into the air.
Cranking an engine causes a heavy load on a battery which can cause the voltage to drop. Ignition systems needed to be designed so they can fire on this reduced voltage, but when the engine is running normal operating voltage is restored, which is then too high for the ignition system. The ballast resistor helps the engine to fire more easily by being bypassed during cranking, and then lowering the voltage when it is inserted into the circuit after the engine has started to minimize wear on ignition components.
More modern solid state ignition systems do not need a ballast resistor, because they have been designed to cope with a wider range of voltages.