The healthcare sector is likely to become increasingly popular over the coming months. Why? The global economy faces a degree of risk that’s exceptionally high with Brexit, a new US presidency and a continued slowdown in China likely to have at least some negative impact on growth rates. As such, healthcare’s low positive correlation with the wider economy is likely to prove popular among investors.

Within the healthcare space, AstraZeneca (LSE: AZN) and GlaxoSmithKline (LSE: GSK) offer remarkably different outlooks. In AstraZeneca’s case, it’s a company in the midst of a hugely challenging period. It has faced the loss of patents on key, blockbuster drugs in recent years and has struggled to replace them. As a result, AstraZeneca’s earnings have fallen by 41% in the last four years. They’re due to decline by an additional 9% over the next 24 months, which may cause some investors to avoid AstraZeneca at the present time.

However, the company’s earnings fall doesn’t paint the full picture. AstraZeneca is in the process of rapidly improving its pipeline through a major acquisition programme. It’s using its strong cash flow and modestly leveraged balance sheet to build a pipeline that has the potential to deliver improved financial performance over the long run. And with its shares trading on a price-to-earnings (P/E) ratio of just 12.7, it has a sufficiently wide margin of safety to merit investment.

A better buy?

This contrasts with GlaxoSmithKline. While it has endured a difficult period thanks to some loss of patents and bribery allegations in recent years, GlaxoSmithKline offers a relatively robust near-term outlook. It’s due to record a rise in earnings of 31% this year, followed by gains of 10% next year. As such, it could outperform AstraZeneca in the near term since its P/E ratio of 15.4 equates to a price-to-earnings growth (PEG) ratio of 1.5 when combined with its growth outlook.

GlaxoSmithKline’s business model also offers greater resilience than that of AstraZeneca. While the patent cycle has a huge impact on GlaxoSmithKline’s earnings, this is negated somewhat by its consumer goods division. Not only does this provide a degree of balance to the business, it also offers significant growth prospects in both the developed and developing world.

In terms of its income potential, GlaxoSmithKline has a yield of 5.2% from a dividend covered 1.2 times by profit. This compares to AstraZeneca’s yield of 5.2%, with its dividends being covered 1.5 times by profit. Both companies have the potential to raise dividends in the long run, although near-term rises may be lacking due to AstraZeneca’s lack of earnings growth and GlaxoSmithKline’s desire to boost its dividend coverage ratio. But both stocks offer relatively reliable and consistent income appeal.

However, with GlaxoSmithKline having a more diversified business model and superior earnings growth prospects, it’s the better buy of the two stocks at the present time. Both companies could benefit from rising uncertainty in the global economic outlook, but GlaxoSmithKline looks set to be the biggest beneficiary thanks to its higher level of stability.

But will either company make you a millionaire?

Of course, finding stocks that are worth adding to your portfolio is a tough task, which is why the analysts at The Motley Fool have written a free and without obligation guide called 10 Steps To Making A Million In The Market.

It's a simple and straightforward guide that could make a real difference to your portfolio returns. As such, 2017 could prove to be an even better year than you had thought possible.

Click here to get your copy of the guide - it's completely free and comes without any obligation.

Peter Stephens owns shares of AstraZeneca and GlaxoSmithKline. The Motley Fool UK owns shares of and has recommended GlaxoSmithKline. The Motley Fool UK has recommended AstraZeneca. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors.