Would you believe that one of the best-performing stocks since May 1 has been The New York Times (NYSE: NYT)? The oft-maligned publishing house missed the market rally over the first four months of the year, falling 20% while the S&P 500 gained about 10%, but since then has charged up over 50%. What happened here?

Looking back at the publisher's recent history, a series of divestments and strong reports helped boost shares.

On May 1, the company reported dramatic improvements in circulation at both The New York Times and The Boston Globe, and the following week, it continued its divestment of outside businesses by selling its remaining stake in the Fenway Sports Group, which owns the Boston Red Sox, for $63 million in cash. After it added two tech-savvy directors to the board, shares jumped another 8% on June 27, when the company announced it was starting a Chinese-language news site, and rallied 7% more over the following days. In its second-quarter report on July 26, the company confirmed its comeback, reporting a slight increase in revenue for the first time in two years. Adjusted EPS was $0.14 per share, beating estimates. On Aug. 8, reports that The New York Times would sell About.com, which had been declining in value, sent shares up another 6%. The upward trend continued through the next week as the company named BBC executive Mark Thompson as its new CEO, driving shares to $9.50, where they trade at today.

What appears to be behind much of this rise is the Times' ever-tightening pay wall, which has started showing results. In April, the newspaper's website cut the number of free articles available per month to nonsubscribers from 20 to 10, and subscriptions have gone up since then, rising 12% from just the first quarter of the year. Using a similar strategy, The Boston Globe scored a 28% jump in digital subscribers.

The New York Times isn't the only newspaper company that's been heating up recently. Shares of Gannett (NYSE: GCI), the largest newspaper chain in the country and the owner of the USA Today, have climbed to near post-recession highs recently. On Wednesday, the stock popped another 4.3% after UBS analyst John Janedis said that pay walls at 70 of its 80 regional newspapers were performing better than expected. Gannett lost fewer subscribers than the 5% management predicted in the move, and Janedis said he now expects circulation revenue growth in 2013 of 12%. Increased television advertising during the Olympics and the presidential campaign has also boosted the media company, which owns a number of TV stations.

Also underpinning the recent lift in newspaper stocks has been Warren Buffett's pursuit of newspapers. Berkshire Hathaway (NYSE: BRK-A) (NYSE: BRK-B) agreed in May to buy 63 regional newspapers for $142 million from Media General, which had previously announced its desire to exit the newspaper business. Buffett also signaled that Berkshire was likely to buy more newspapers in the near future, citing the value of local news to towns and small cities, and saying that the newspapers need to stop giving away their product -- i.e., content -- for free.

Foolish takeaway
Based on their pay wall strategies, the big chains seem to agree with Buffett. The main question for the newspapers should be: "What took so long?" Print advertising, once the main driver of industry revenue, peaked at $48.6 billion in 2000, but newspapers since then continued to offer their content for free in one channel (digital), while charging in another (print). That seems like a losing strategy if there ever was one.

While the Internet means steeper competition with the likes of AOL's (NYSE: AOL) Huffington Post and other online aggregators, newspapers still have an advantage they can leverage when it comes to content and firsthand reporting. Digital advertising revenues continue to decline, but a paying customer beats a freeloader, and is also more valuable to advertisers. More pay walls also mean a less fragmented industry, as readers will have to commit to their news source of choice. This should in turn make advertisements more valuable, since readers will have a harder time avoiding them. If circulation revenues continue to increase, that should eventually push digital ad revenues higher. Look for this trend at The New York Times and Gannett when they report earnings in October and in future quarters.

Just as the Internet forever changed the newspaper business, so are new technologies transforming other industries right as we speak. One up-and-coming area is data mining and business intelligence, which is helping businesses become more efficient. Our special free report reveals the company that is head-and-shoulders above the competition in this industry. Find out the name of this hot stock that the Fool is calling "The Only Stock You Need to Profit From the New Technology Revolution." You can get your free copy now. Just click right here.