Shares of HCA Holdings Inc. rose to an all-time high Wednesday after the hospital operator boosted its earnings outlook for the full year.

The company, which is based in Nashville, Tennessee, said it did better in the second quarter than it expected, thanks to the health care reform law and an increase in Medicaid revenue.

HCA said it now expects 2014 adjusted earnings between $4 and $4.25 per share, up from its previous forecast between $3.45 and $3.75 per share. Analysts expect earnings of $3.70 per share, according to FactSet.

For the full year, the company now expects revenue between $36 billion and $36.5 billion, narrower than its previous range between $35.5 billion and $36.5 billion. Analysts expect revenue of $35.93 billion.

For the second quarter, it expects adjusted earnings of $1.07 per share and revenue of about $9.23 billion. Analysts expect earnings of 91 cents per share and revenue of $8.85 billion.

The company will release its second-quarter results on or about July 29.

HCA shares rose $5.78, or 10.5 percent, to close at $60.99. Earlier, they rose as high as $61.44, an all-time high for the stock.