Sounds like the rectifier in the alternator was on its way out. Good thing you caught it before it totally shorted out. I have also seen this symptom when the brushes on the alternator get worn down so far that they get sideways and dont make good contact with the commutator.