Whoa. I'm still impressed with Facebook's (NASDAQ:FB) second-quarter results. Its already massive revenue growth rates accelerated. Even more surprising, Facebook's mobile revenue surged to 41% of total revenue while its non-GAAP operating margin expanded 100 basis points. Meanwhile, Google (NASDAQ:GOOGL) is finding the mobile environment to be quite challenging.

Opportunity or threat?
Google insists the shift to a mobile operating environment is an opportunity -- "a tremendous opportunity," according to a Seeking Alpha transcript of the company's second-quarter conference call. "With more devices, more information, and more activity online than ever, the potential to improve people's lives is immense," Google CEO Larry Page continued.

But the environment is arguably presenting the company with some significant challenges. Particularly, Google's operating margin is suffering. Its non-GAAP operating margin declined to 28% in the second quarter from 33% in the year-ago quarter. Google's competitive landscape is certainly tougher than it was several years ago.

Google provides two key metrics to gauge the health of its ad business. Management advises analysts to look at paid clicks and cost per click, or CPC, together to get an accurate picture. But I'd like to make an objection to this guidance. Search and online browsing (together on apps and Web browsers) are both undoubtedly growing businesses. For that reasons, I would expect Google's paid clicks to increase substantially every year. If paid click's suffered, that would be a huge red flag.

Though Google doesn't provide browsing data, it did note in its 2012 annual report that its number of search queries is growing: "a significant increase in mobile search queries and a deceleration in the growth of desktop queries." This statement also indicates that Google's desktop search queries are growing, too, albeit at a slower rate.

Given these assumptions, is a 23% increase in second-quarter paid clicks from the year-ago quarter really that impressive? After all, that's a significant deceleration from Google's 34% year-over-year growth in paid clicks in 2012. Even more, with search query volume growing, shouldn't paid clicks naturally grow in lockstep?

So let's separate the usefulness of both metrics. Paid clicks should be growing. CPC is defined as the average amount advertisers pay Google when someone clicks on their ad. So how effectively is Google converting paid clicks into revenue from advertisers? Unfortunately, Google's recent CPC trend has been disheartening.

Source: SEC filings for respective quarters shown.

Google's shift to a mobile operating environment may be an opportunity for more revenue, but it's a definite challenge as far as Google's profitability goes. Buried in Google's annual report, the company even acknowledges this shortcoming among its listed risk factors:

Our revenue growth rate could decline over time, and we anticipate downward pressure on our operating margin in the future ... as a result of a number of factors, including increasing competition, changes in our product mix, including a significant increase in mobile search queries and a deceleration in the growth of desktop queries if monetization stays at current levels.

Facebook's opportunity
Facebook is handling mobile revenue quite differently. It was just three quarters ago when it began reporting mobile revenue. It came in at 14% of total advertising revenue. In the company's most recent earnings release, mobile advertising revenue has surged to 41% of total revenue. Meanwhile, Facebook's profitability has improved. The company's non-GAAP operating margin expanded by 100 basis points from the year-ago quarter.

Going forward, Facebook investors are hoping for Facebook's transition to mobile to continue at a rapid pace. Google investors, however, face a conundrum. Sure, it's important that Google fortifies its position in mobile. But don't expect Google's profitability to benefit from the transition.

Leveling the playing field
So Google faces challenges in mobile and Facebook faces tremendous opportunity. Does this mean Facebook is a better buy than Google? Absolutely not.

Valuation matters. And investors must fork out a significant premium to buy into Facebook's growth story. The company trades at 14 times sales. Meanwhile, Google trades at 5.2 times sales.

Valuation, therefore, brings expectations down to reality. But if there is a hard takeaway from this mobile development, it's that investors with an ultra-long-term view (greater than five years) might want to take a closer look at Facebook. The mobile environment isn't easy, but Facebook's handling it like a champ.

Fool contributor Daniel Sparks has no position in any stocks mentioned. The Motley Fool recommends and owns shares of Facebook and Google. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.