The battle between desktops and the Web is one that will play out for many years to come, but there’s a particularly sharp illustration of it on Wall Street this week.

On Monday, Google overtook Microsoft as the world’s second-most valuable technology company as the firm kept to the rising track it’s been on for the past three months. As the market opened Tuesday, the companies’ values were back in their normal places but still very close. As of 11 a.m., Google had a market capitalization of $247.33 billion; Microsoft’s market cap stood at $248.97 billion.

It’s been a little over two years since Apple passed Microsoft as the world’s most valuable technology company, a change that itself was seen as a sign that mobile computing was well on its way to eroding the PC market.

As we all know, that’s definitely been the case: PC shipments have fallen as tablet and smartphone shipments continue to rise.

The PC market got a further blow Monday after the IHS analysis firm dramatically cut its 2012 shipping estimates of ultrabooks — the trend that was supposed to save the PC industry this year — to 10.3 million from 22 million. Estimates for next year were nearly as grim, with analyst Craig Stice updating his prediction to be 44 million in shipments from 61 million.

With falling PC sales come troubled PC software sales, part of the reason that Microsoft is going after the cloud in full force.

But Google is already there. Google started there. And in almost every place the two companies compete — search, mail and cloud-based document management, to name a few — Google has managed to keep an edge over Microsoft.

Plus Google is, for lack of a better word, on a tear lately. The company’s been climbing steadily since July, when shares were trading at around $570 each.

Microsoft, meanwhile, has seen its stock fluctuate a bit as it tries to reboot its Windows system with the introduction of Windows 8 and its tablet system, Windows RT. Between its operating system relaunch, its upcoming plans for a new version of its Windows Phone mobile system and strong hold on the U.S. video game market, many analysts are saying that it’s too early to count Microsoft out.

It should also be noted that Microsoft has a habit of hanging on to second place — IBM also passed the Bellevue, Wash. firm for time in 2011. Microsoft retook its position the next day.

Related stories:

Google turns 14: A look at the birthday-gift table

Microsoft tablet partners announced amid rumors of $199 Surface

Apple Maps vs. Google maps: Which is better for D.C. navigating?