Herb meant to say have battery and alternator TESTED for free.
It sounds like the alternator to me since the car cannot keep up with the heavy current draw when the headlights are on.
But you should have the alternator tested first, it could be a bad battery connection, the IVM module or a grounding issue.
Straight lines are for fast cars...turns are for fast drivers
'04 M3 - track
'06 650i Cab - daily driver
'02 Highlander - kid hauler
'01 330Ci - winter beater