Nearly every company goes through challenges and a period of uncertainty about the future. Some endure hardships that seem to never end and can take years to unwind. The two companies in today's matchup have come up against such trials -- things have gone wrong and they just can't seem to get a break.

Baidu, Inc. (NASDAQ:BIDU), commonly referred to as the "Google of China," is the leader in online search in the world's most populous country. After being a stock market favorite for much of its history, the company has dealt with slowing growth, increased competition, scandals, and regulatory hurdles.

Social-media site Twitter, Inc. (NYSE:TWTR) saw its share price skyrocket shortly after its IPO, only to see it begin a decline that continues today. The company has seen falling user additions that brought revenue growth to a halt.

Investors looking to capitalize on the uncertainty will want to know: Which company is the better buy now?

A businessman talks by phone, with a city skyline behind him. In front of him is an overlay of a rising stock chart.

Which company can climb the wall of worry and return to growth? Image source: Getty Images.

Financial fortitude

Baidu's ever-increasing debt load is related to the big bet on streaming video by its iQiyi segment, much like its U.S. counterpart Netflix. While it bears watching, Baidu has the resources to pay down that debt over several years, so no worries there. Both companies have a sufficient amount of cash, but we have a clear winner in terms of income production and free cash flow. Previous investments allow Baidu to produce cash flow that exceeds its current income by a wide margin. Free cash flow is the more accurate measure of a company's financial health, so in this round Baidu emerges victorious.

Company

Cash

Debt

Net Income (TTM)

Free Cash Flow (TTM)

Baidu

$2.11 billion

$7.35 billion

$1.69 billion

$2.27 billion

Twitter

$1.19 billion

$1.54 billion

($439 million)

$604 million

Data sources: YCharts and SEC filings. Chart by author. TTM = Trailing 12 months.

Winner: Baidu.

Recent results and growth prospects

In its most recent quarter, Baidu reported revenue of $2.45 billion, up 6.8% over the prior-year period. Earnings of $258.1 million fell 10.6% year over year. While the company's online advertisers fell by 23% over the prior year as the result compliance with new government advertising regulations, its remaining customers spent an average of 27% more, accounting for the revenue increase. Baidu has been working to weed out unscrupulous advertisers, which will benefit the company going forward, and it expects revenue to reverse course later this year. 

In Twitter's corresponding quarter, revenue fell to $548 million, an 8% year-over-year decrease. Its net loss of $62 million was an improvement over the $80 million loss in the prior-year quarter. Having recently added streaming live video to its platform to better compete with other social-media sites, the company did report an increase in daily active users for the fourth consecutive quarter -- though advertisers are still unwilling to pay up for that growth.

The company continues to dig itself into an even deeper hole, spending $117 million on stock-based compensation. Twitter expects to produce essentially breakeven earnings for the coming quarter. 

Baidu is battling a temporary revenue setback as the result of increased regulations, while Twitter continues its longer-term downward revenue trend. In both recent results and growth prospects, Baidu is better off.

Winner: Baidu.

Stock performance and valuation

Over the past year, Twitter has edged out the broader S&P 500, with a 22% return to the market's 16%. Baidu has lagged both, up a paltry 6%.

TWTR Chart

Data by YCharts

There are a number of methods to use to determine valuation, but the majority aren't appropriate for a company with negative earnings like Twitter. The lack of profitability renders the P/E and PEG ratios useless. However, using the price-to-sales ratio shows Twitter with a multiple of 5, slightly less expensive than Baidu's 6 times trailing sales. Using estimated earnings to look ahead, Twitter sports a nosebleed 52 times forward earnings, compared with Baidu's less expensive but still high forward multiple of 33.

Twitter comes out ahead on stock performance, while there's no clear winner on valuation, so this round goes to Twitter.

Winner: Twitter.

Final tally

The results are in, and Baidu has the clear victory. Both companies have been hit with hard times, but Baidu is the better choice for new money right now, as it's a growing company that's creating cash to plow back into the business.

Danny Vena owns shares of Baidu and Netflix. The Motley Fool owns shares of and recommends Baidu, Netflix, and Twitter. The Motley Fool has a disclosure policy.