Investing in the world of healthcare can be downright scary. Just look at what happened nearly overnight to shareholders of Celldex recently. But when you consider the broader trends driving the sector -- aging population, smaller uninsured numbers, higher drug prices -- you'd be crazy to not want some exposure in your portfolio.

One of the easiest ways to invest in individual healthcare companies without losing sleep at night is to put your money behind big, diversified, well-known drugmakers. Two of the best-known names in the space are Pfizer (NYSE:PFE) and GlaxoSmithKline (NYSE:GSK). But which is the better buy? We'll put them head to head.

The major breadwinners

Respiratory drug Advair has long been GlaxoSmithKline's workhorse, but with its patent all but fully expired, GlaxoSmithKline has released several new drugs to breathe new life into its respiratory franchise. Two of them, Breo Ellipta and Anoro Ellipta, both wheezed out of the gate, but it looks as if they're finally starting to catch their breath. Both drugs posted over 170% year-over-year growth in the first quarter of 2016.

Glaxo's HIV drugs have also been essential to its growing top line. Revenue from Tivicay increased 60% year over year, and Triumeq posted a whopping 193% growth. It will be essential for Glaxo going forward that these therapies continue to grow, as revenue from Advair will only continue to shrink.

Pfizer, on the other hand, has had great success with its oncology drugs as of late. After a 2015 approval, breast cancer drug Ibrance started 2016 on track to post $1.6 billion in sales for the year. Sutent and Xalkori also helped drive overall oncology revenues 95% higher from Q1 2015.

Another key drug in Pfizer's lineup is the next-generation blood-thinner Eliquis, which is co-owned with Bristol-Myers Squibb. This factor Xa inhibitor posted 80% year-over-year growth in the first quarter of 2016 to reach $354 million. The lone blemish in Pfizer's performance this past quarter was a 24% decrease in sales of drugs that have come off patent protection .

This, of course, is the central dilemma facing both companies: Can new successes outpace losses from drugs coming off patent? I'm thinking that for both companies, the answer is yes.

What's coming next

GlaxoSmithKline's asset swap with Novartis means that vaccines will be a big focus going forward. I'm not normally one to get excited when I see a company is expanding its vaccines portfolio, but Glaxo boasts margins of 29% in this business, which is just slightly below the 31% it claims in its pharmaceutical unit. The standout in this segment is shingles vaccine Shingrix, which is looking at a 2017 approval, and if it gets it, it'll probably bring in several billion per year.

Glaxo isn't done boosting respiratory drugs; Nucala was just approved late last year, there are two phase 3 drugs itching to get approval, and there are plenty more phase 1 and 2 respiratory drug candidates ready to follow. Across all indications, Glaxo boasts over 40 drugs in development.

Pfizer has several important phase 3 drug candidates, but it's clear that the next big thing for the company will be growth by acquisition. After $160 billion plans to join forces with Allergan fell through, Pfizer is clearly feeling pressure to find something else to do with its pile of cash. It recently made a $5.2 billion acquisition of Anacor that seems to have been overpriced, and I don't think the company is done shelling out money for new assets just yet. I can't help comparing this sense of impatience to the mind-set of Gilead Sciences, a company that has been under external pressure to make an acquisition for years but is waiting patiently for the right opportunity.

The last wild card for Pfizer is a potential splitting of the company into individual units to separate the high-growth side of the business from the slow-growth side. There's been speculation over this for years, but still no one can say for sure when or if this will happen. One thing I'm confident of, though, is that Pfizer in 5 years will look nothing like Pfizer today -- for better or for worse.

Winner of the battle?

Ultimately, these are both stocks in periods of transition -- and there are plenty of question marks surrounding their future, making it difficult to predict an ultimate winner. While neither of these companies offers the tantalizing growth potential of some smaller players, I do believe both are relatively safe investments that will serve long-term shareholders well.

The most important thing to keep in mind in comparing the two is that you're looking at future potential, not past performance. While you could argue that Pfizer looks more solid at the moment (until Glaxo gets its respiratory franchise officially back on track), its unknowns are of much greater proportion than Glaxo's.

The winner becomes even clearer when you consider two final factors: leadership and shareholder friendliness. GlaxoSmithKline's CEO, Sir Andrew Witty, is a remarkably effective leader. Witty claimed going into 2015 that the company would produce double-digit EPS growth in 2016, which sounded crazy at the time -- but the company is on track for easily hitting that goal.

Meanwhile, Glaxo's dividend is the heart and soul of my conviction in this stock. Its 5.2% return wallops Pfizer's admittedly admirable 3.5%, and it doesn't appear to be on the chopping block anytime soon. With that amount of cash going straight into your pocket (or back into more shares) each year, GlaxoSmithKline seems to me like the better buy.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.