Cloud-based electronic health-record and practice-management provider Athenahealth is buying mobile health firm Epocrates for $293 million in cash. The sale is expected to be finalized by the second quarter of this year.

Athenahealth executives said in a broadcast that the company will embed Epocrates apps and information in their offerings, such as collections service AthenaCollect. Epocrates clients will be introduced to Athenahealth capabilities on a rolling basis.

The acquisition unites two companies that launched as the Internet boom went bust. Athenahealth, which has 2,000 employees and reported $324 million in revenues in 2011, was founded in 1997. Epocrates launched in 1998 and closed 2011 with revenues of $113 million. Unlike Athenahealth, whose Q3 2012 results included $106 million in revenues, up 26% from the same period the year before, Epocrates has been struggling. The San Mateo, Calif., company derived 60% of its 2011 revenues from providing a communication channel between pharmaceutical companies and healthcare practitioners through services like its Mobile Sample Closet.

The company noted that throughout the previous three quarters “an unusually high number of unused license code expirations” added downward pressure on subscription sales.

Athenahealth president and CEO Jonathan Bush said in his presentation that Epocrates was appealing because the services it offers are immediately usable, and he wants to imbue his company with the new subsidiary’s reach and skill. “We want that user experience DNA to be part of everything at Athena,” he said.