The voltage regulator is responsible for maintaining a constant voltage output from the alternator. If the voltage regulator fails, the voltage output from the alternator can become too high or too low. This can cause the battery light to come on, indicating that the battery is not being properly charged.