Headlights dimming when the bass hits is not an uncommon problem. Some will tell you that you need to add a second battery but that's actually the worst thing you could do. The problem is being caused by the large, sudden current draw that your subwoofer amplifier requires when bass notes are played at high volume. If your electrical system (especially your alternator) can't keep up then your vehicle voltage will drop and cause the headlights to dim. If you have a battery gauge in your dash cluster than you may see it drop to the beat as well.
The first thing you need to do is have you electrical system checked. It's likely that your alternator can't keep up with the extra current demands. Have that and the battery checked by a qualified technician. Some auto parts supply stores will test it for free. If your system isn't up to snuff than you should fix that problem first. You might even consider getting a larger alternator. Consult a qualified mechanic before attempting this. If you're still having the problem then a power capacitor might solve your problem. A large power capacitor (size depends on your stereo power rating, usually one Farad per 1,000 watts is recommended) connected very near your amplifier can help.
A power capacitor acts as a buffer for your electrical system. It stores an electrical charge and will release it quickly. This extra "juice" will supply your subwoofer amplifier with the current it needs without going to the battery for help. This is usually the cure for the dimming headlight syndrome. Adding a second battery will only increase your "engine off" listening time. After the engine is started you will (should) be getting all of your power from the alternator. The second battery becomes an additional load on the alternator once the engine is running.
The Car Audio Help DVD catalog includes five different videos covering many areas of car audio installation and custom fabrication. Topics range from basic system installation (head units, amplifiers, speakers, etc.) and mobile security (car alarms and remote start) to subwoofer box design and fiberglass fabrication. If you're interested in custom fabrication and car audio installation be sure to check out what we have to offer.