A logo of the Blackberry maker's Research in Motion is seen on a building at the RIM Technology Park in Waterloo in this April 18, 2012 file photo. (MARK BLINCH/REUTERS)

Here’s a tech stock pop quiz: Who has had a better quarter on the stock market? Apple? Or Research in Motion?

The answer may surprise you. Apple’s stock, which peaked at more than $700 per share in September, has lost nearly 25 percent of its value. But RIM, which reported strong earnings Thursday, has seen its stock more than double its abysmal September price of $6.30 per share. On Thursday, the stock closed at $14.12 and continued to climb in after-hours trading.

It’s a strange role reversal for the companies, which compete heavily in the smartphone market but have been on opposite trajectories for the past three years. Since Apple’s iPhone passed the BlackBerry in U.S. market share two years ago, the Cupertino, Calif., firm has become the dominant player in the smartphone market. Meanwhile, RIM’s grip on security-conscious government workers and corporations began to wane and it fell hard on complaints that it wasn’t innovating quickly enough.

Now RIM is the underdog, scrambling for a foothold in the market, while Apple is the tech titan fighting worries about its ability to innovate.

Apple and RIM did not immediately respond to a request for comment on their stock performance

BlackBerry's stock is on the rise while Apple's is declining.

Analysts have tried to pinpoint a reason for Apple’s declining share prices, citing everything from a stock market correction to supply constraints for its most popular products to concerns that Apple’s pace of innovation may be flagging.

While the company is still one of the most widely held stocks and the largest publicly traded U.S. company, the bug-ridden launch of its mapping program and resulting executive reshuffle raised some doubts about the company’s future, even among its most loyal fans. Apple has refreshed the majority of its product lines, but even the introduction of an iPad mini didn’t convince critics that Apple has kept up with the pace of innovation set under its late co-founder, Steve Jobs.

The “fiscal cliff” negotiations are also hanging over Apple’s shareholders — namely rules that would increase the capital gains tax, Motley Fool analyst Andrew Tonner said. Some lawmakers have proposed raising the capital gains taxes to 20 percent from 15 percent, which could spur longtime investors to sell now and avoid a bigger tax bill.

“Investors could be looking at themselves and saying, ‘Apple had a great run, but maybe I want to get out now at a lower rate of taxation,’ ” said Tonner, who holds Apple stock.

But those decisions could also show that investors are not sure Apple has much higher to go, said Colin Gillis, a technology analyst for BGC Partners. The company is locked in a smartphone battle with Google’s Android operating system, which has eclipsed Apple’s iOS in the global market. And so many people have iPhones that the company may be nearing a saturation point.

“Even with the capital gains tax, if you thought it had a lot of legs in it, you’d probably want to hold onto it,” Gillis said. “But how many more doubles does it have in it?”

Meanwhile, RIM is enjoying something that has become scarce since it lost its hold in the U.S. smartphone market — hope. Under new leadership, the company has excited investors with plans to launch a slick, high-end smartphone operating system next month. New handsets could help RIM regain its status as a major player in the smartphone market dominated by Apple and Google, which share roughly 95 percent of the American market, according to consumer research firm Kantar Worldpanel.

RIM has a lot of catching up to do. Even when its strongest bases, such as the Middle East and Europe, are included, the company still captures only 4.7 percent of the market.

RIM beat analyst estimates, reporting $2.7 billion in revenue for the third quarter, above expectations of $2.65 billion. The company reported a loss of $114 million, or 22 cents per share, but that was also better than expected.

Still, analysts’ focus remains not on Thursday’s quarterly report but the future. The company must deliver on its promises; fight aggressively to gain market share around the world while its smartphone business finds its legs; and, above all, run lean.

“I don’t see RIM being out of business in a year,” Gillis said. “But they may need to live on a much smaller expense base and volume of handsets shipped.”

Related stories:

Patent office rejects Apple’s ‘pinch-to-zoom’ claim

Research in Motion shows off BlackBerry 10 with keyboard

Research in Motion reports earnings

Sign up today to receive #thecircuit, a daily roundup of the latest tech policy news from Washington and how it is shaping business, entertainment and science.