Source: Google Maps

The Supreme Court decision to leave health insurance subsidies untouched is sparking a rally in hospital stocks that's resulting in double digit gains for Community Health (NYSE:CYH), HCA Inc (NYSE:HCA), and Universal Health Services (NYSE:UHS). Read on to learn more about how the Supreme Court's decision in the King v. Burwell case affects these industry leaders and whether or not one of them is worth buying in portfolios.

The back-story
The King v. Burwell case challenged whether or not a strict interpretation of the language contained in the Affordable Care Act allows for the granting of subsidized insurance in states choosing not to establish their own health insurance exchange.

A Supreme Court ruling in favor of the plaintiffs would have eliminated subsidies for 6.4 million people living in the 34 states relying on the federally run health insurance exchange.

The elimination of subsidies in those states could have significantly affected hospitals, many of which have enjoyed a steep drop-off in the amount of money they've had to set aside to cover the cost of caring for the uninsured following Obamacare's implementation.

The decision of the Supreme Court to rule in favor of the government removes the risk that unsubsidized insurance costs would lead to people canceling their health insurance plans, causing write-offs at hospitals to climb again.

Crunching the numbers
The amount of money the hospital industry sets aside for doubtful accounts, such as those associated with the uninsured, has fallen by hundreds of millions of dollars over the past two years, but the impact differs from company to company.

At Community Health, the company's provision for bad debts during the first quarter totaled 13% of revenue, down from 14.3% a year ago. HCA's provision for bad debts was 6.25% of sales, versus 8.8% a year ago, and Universal Health set aside 6.5% of its sales to cover doubtful accounts in the first quarter, down from 9.7% the year before.

If you add up the amount set aside for doubtful accounts by these three hospital operators during the first quarter, it totals a whopping $1.53 billion, down from $1.75 billion in the same quarter of 2014.

That suggests that keeping Obamacare subsidies intact potentially helped protect $220 million in revenue at these three companies in Q1 alone!

Or, looking at this dynamic another way, if we multiply this year's Q1 sales by the percentage of revenue set aside last year then we're talking about an additional $411 million that would have had to theoretically be set aside last quarter.

Looking ahead
HCA is the largest of these three operators in terms of revenue, and it arguably had the most to lose if subsidies were eliminated.

Using 2013's rate of provision for doubtful accounts, HCA would have had to set aside $261 million more during Q1 than it did. Community Health and Universal Health's provision for doubtful accounts would have been $74.5 million and $75.7 million higher, respectively, based on this calculation.

However, investors shouldn't buy HCA just because its size means that it's affected a great deal by the Supreme Court's decision. After all, there are plenty of other considerations to keep in mind too, such as each company's valuation and financial position.

For example, HCA's shares are trading at 15.7 times next year's estimated earnings, and its current ratio, which measures its ability to pay off short term creditors if they come knocking, is a low 1.27.

That's better than Universal Health, which has a forward P/E of 19.9 and a current ratio of 1.37, but it's not as good as Community Health, which is trading at 13.7 times next year estimates and has a current ratio of 1.72.

Overall, when I consider the opportunity for improvement alongside valuation and financial condition, I think that out of these three, its Community Health that is the most deserving of investors' attention.