MARBLEHEAD – An electrical junction box in the Eastern Yacht Club overheated, said a town fire captain, starting a three-alarm fire early Friday morning that severely damaged the Foster Street building.Firefighters from Lynn, Lynnfield, Swampscott and other communities helped put out the fire after multiple phone calls brought town firefighters to 47 Foster St. at 11:54 p.m. Thursday. Fire commanders struck a second alarm after spotting smoke “showing through the roof,” according to descriptions of the fire response in the Police Department dispatch log.Fire Capt. Michael Porter said people on the club?s second floor spotted smoke and exited the club as firefighters converged on the club?s attic and roof and cut holes to vent smoke. Fire commanders struck a third alarm at 1:02 a.m. on Friday.?The fire was very difficult to get at,” Porter said.Lynn firefighters initially reported the fire “knocked down,” according to the dispatch log, at 1:46 a.m., but within minutes Swampscott firefighters spotted fire and crews finished putting out flames in the attic while other firefighters helped extinguish a fire in the front of the building.Incident commanders reported the fire out at 2:14 a.m.Responding fire crews left Foster Street by 5 a.m. but Porter said a town crew remained on the scene while investigators worked their way through the club.Porter said Fire Capt. Elizabeth Wilson commanded the fire response until Marblehead Chief Jason Gilliland arrived. Responders assisting firefighters included Roger Baker and Rehab 5, a truck loaded with water and cooling tents to aid firefighters recovering from fighting a fire.?We got a lot of help from other communities,” Baker said.The annual National Offshore One Design Regatta, which is held in conjunction with the 125th Marblehead Race Week, is to be hosted June 24-27 by the Corinthian Yacht Club. The regatta rotates between Marblehead?s three clubs, the Corinthian, Eastern and Boston.