Bosch units have an all-in-one regulator and brush holder at the back. It'll look something like this:
or might be just a black box. If you have anything like that on the back of the alternator, change it (?10 to ?20) and it'll most probably be fine.
Magnetti Marelli alternators have a separate brush holder and regulator and have a triode within the alternator to control the charging light. The triode is soldered but if the joint is broken and sometimes touches it'll cause the symptoms you described.
The Magneti Marelli regulator will probably look like this:
But it won't be your problem, the problem will be inside the alternator.
Of course if the charging is erratic as well and it's not just the light, you should change the carbon brushes.