FB data by YCharts.

Shares of Facebook (META 0.43%) and Netflix (NFLX -0.63%) have gained roughly 140% over the last three years. The social media giant and the digital video expert are market darlings trading at elevated valuations, and investors in both stocks are expecting great things in the next few years.

Which one is the better buy right now? Let's find out.

The case for Facebook

The world's largest social network has come a long way from its cash-poor beginnings. Facebook is striking a careful balance between user-friendly services and ad-powered monetization, collecting $8.7 billion of free cash flow out of $24.7 billion in top-line revenue over the last four quarters.

In spite of promising financial trends and fantastic long-term market returns, Facebook's stock has been spinning its wheels lately. Share prices have risen just 12% over the last 52 weeks, including an 11% drop so far in November alone. Soft earnings expectations unveiled in the third-quarter report led to a 5% single-day loss, and then the U.S. elections rolled around.

Some observers have pinned Donald Trump's victory directly on Facebook's lapel, because the social network holds such a central place in the modern media landscape.

Image source: Pew Research Center.

A recent Pew Research Center report notes that nearly two-thirds of adult Americans (some of whom are potential voters) get their news straight from social media sites, including 66% of self-reported Facebook users. That's a high level of trust and audience engagement, making Facebook a powerful tool for swaying public opinion.

That would be fine, if Facebook's News Feed was a meticulously managed and fact-checked supply of serious news. But the feed is often polluted by less-than-reliable content, ranging from benign satire to downright hoax materials. And these are taken at face value more often than they should. It's worth noting that Trump's campaign and even the occasional serious news site have been seen redistributing absolutely fake election stories.

For now, Facebook and other online titans have vowed to separate fake news sites from their lucrative advertising programs, hoping to put a long-term stop to that troubling trend. Meanwhile, CEO Mark Zuckerberg insists that Facebook should not play the role of editor for the global news flow -- and that his service surely doesn't hold the power to influence presidential elections anyhow.

This controversy has weighed heavily on Facebook's stock. Investors aren't sure whether the company will make large changes to crucial advertising policies, thereby changing the financial equation in hard-to-predict ways. In the worst-case scenario, Facebook might overplay its hand and fade into the background like so many former social network leaders before it. That would destroy the cash machine Facebook worked so hard to build.

So Facebook stock is financially stable but also on sale at the moment. Fellow Fool Evan Niu argues that this, too, shall pass -- it's nothing but a great buy-in opportunity. I agree that it's a tempting idea, but Facebook is still hardly a risk-free bet.

The case for Netflix

Unlike Facebook, Netflix is not strongly profitable. Bottom-line earnings have been hovering just above the breakeven point for years, and the free cash flow chart may trigger night sweats in value-conscious investors:

NFLX Revenue (TTM) Chart

NFLX Revenue (TTM) data by YCharts.

The top-line revenue trend tells a different story, of course. So does the subscriber count. Five years ago, Netflix had just canceled the ill-conceived Qwikster separation and served 23.8 million unique subscribers across its digital-streaming and DVD-mailer plans. Today, Netflix offers streaming video services around the world (with a couple of notable exceptions), and the subscriber list has nearly quadrupled to 86.8 million names. Management hopes to add another 5.2 million net new subscribers in the fourth quarter.

CEO Reed Hastings plans to deliver "significant profits" in 2017, but has yet to explain exactly how large the bottom-line jump might be. The expensive and expansive global rollout is pretty much done, allowing Netflix to redirect its technology and marketing start-up budgets into a big bucket of bottom-line profits instead.

But those cash flows are not turning positive anytime soon. The company is investing heavily into original content production, which comes with large up-front cash costs. The idea is to take that cash hit now, build a lasting subscriber-attraction machine around the resulting movies and serialized shows, and reap the rewards of loyal customers for many years to come.

If that plan works out as expected, today's massive cash investments should pay dividends for the long haul as Netflix exploits its in-house productions as any other media production powerhouse would. Once created, those shows won't cost Netflix another dime. Beyond filling up its own content catalog, the company could also sell DVD sets and license its own titles to traditional TV networks. In fact, that looks like the only avenue into China at the moment -- and Hastings is perfectly open to that strategy.

Long story short, Netflix's various profits may look impossibly thin right now, but that should change over the next few years. In my view, these are the humble beginnings of a global media titan, and there's probably a hockey-stick moment coming up as early as 2017.

The final verdict

I can't fault investors for going long on Facebook, particularly when temporary share-price discounts add to the stock's long-term value. That said, Netflix promises an even-larger return for the truly long haul.

Netflix is my largest real-world investment position today, and will probably stay that way until I retire. If I were building a new portfolio from scratch right now, Facebook might get a nod but Netflix would still dominate.

It's really that simple.