Athenahealth shares soared Monday after the struggling medical billing software maker received a $5.7 billion cash buyout offer.Veritas Capital and Evergreen Coast Capital plan to give athenahealth shareholders $135 per share in a deal that will take the company private. That represents a roughly 12 per cent premium over the closing price of athenahealth shares on Friday.But the latest deal is smaller than a $6.5 billion bid that prominent investor Elliott Management Corp. made in May.Elliott Management made its offer for $160 per share in cash after saying it had grown frustrated with athenahealth’s struggles, which included missed guidance targets and churning through five chief financial officers in the last four years.A month after Elliott made its offer, co-founder and CEO Jonathan Bush said he was stepping down.Athenahealth said Monday that Elliott Management supported the latest deal offer. Evergreen Coast Capital is an Elliott affiliate that invests in technology.Athenahealth, based in Watertown, Massachusetts, makes medical record, revenue cycle and care co-ordination products and delivers most of it through the cloud. On Friday, it reported third-quarter earnings that topped analyst expectations, but its revenue fell short of the average forecast on Wall Street.The latest athenahelath bid offers “a decent valuation for what has increasingly appeared to be a struggling business,” Leerink analyst David Larsen said in a research note.“We believe that following the long and tumultuous sales process it is unlikely another bidder will emerge,” he wrote.Evergreen and Veritas plan to pair athenahealth with Virence Health, which Veritas bought earlier this year. The combination will operate under the athenahealth brand and stay headquartered in Watertown, Massachusetts. Virence Chairman and CEO Bob Segert will lead it.Athenahealth’s board of directors unanimously approved the deal, which the company expects to close in the first quarter. Shareholders still have to vote on it.Athenahealth stock jumped about 9.5 per cent, to $131.73 while broader indexes slipped Monday morning.