Yesterday, the Dow Jones Industrials (^DJI 0.67%) set yet another all-time record high, the latest in a string of more than 20 new records so far this year. But for long-term investors, it's far more important to focus on the long haul than to get carried away in the bull market of the moment.

To get you thinking more about the long run, I did some digging around to look for stocks that have contributed the most to the gains in the Dow not just in 2013 but over the course of nearly a century of stock market ups and downs. With some help from S&P Dow Jones Indices, here are three stocks that dramatically outperformed the Dow during their tenure as components of the Industrial Average.

3. Procter & Gamble (PG 1.52%)
Consumer giant P&G has been in the Dow since 1932, and since then, the stock has posted a total return of more than 61,000%, nearly tripling the Dow's 21,600% gain over the same time period. Yet P&G had been around for nearly a century before joining the Dow, as the fledgling soap and candle business started operating in 1837 and hit sales of $1 million by 1859. From early products like Ivory soap and Crisco shortening to more recent innovations like Tide laundry detergent, Procter & Gamble has anticipated the needs of consumers and made household products to meet those needs. With annual income going from just over $9 million in the year it joined the Dow to $10.8 billion last year, P&G has delivered the fundamentals that have supported its big share-price run-up.

2. ExxonMobil (XOM 0.57%)
Joining the Dow as the Standard Oil Company of New Jersey, the company we know now as ExxonMobil is the product of some massive mergers over the years, with the most recent being the joinder of Exxon and Mobil that was completed in 1999. Since joining the Dow in 1928, Exxon has produced total returns of 109,000%, compared to just a 4,400% gain for the Dow, reflecting a much higher starting point from before the Crash of 1929.

Interestingly, though, Exxon could potentially have been larger still if it hadn't been for antitrust litigation against Standard Oil that broke up the company in 1911. Although Standard Oil of New York eventually became Mobil and therefore came back into the fold, Standard Oil of California later became the other major Dow energy component, Chevron (CVX 1.20%). Other parts of the company became parts of most of the other major oil companies in existence now, many of which have produced impressive returns of their own.

1. Sears, Roebuck
Sears isn't part of the Dow anymore, and the decision to eject Sears from Dow was one of the best timing decisions the average ever made. From 1924 to 1999, Sears produced returns of nearly 238,000%, crushing the Dow's return of less than 11,000% over the same period.

Known best for its pioneering catalog sales, Sears went on to become a big-box retail giant. Of course, shortly after its exit from the Dow, the company fell on hard times, and in early 2005, Kmart closed on its merger with Sears to create Sears Holdings (SHLDQ). The company has never returned to its former glory, but those long-term investors who got out of the stock earned some of the best returns the Dow has ever known.

Sticking with winners
You won't often find stocks that perform this well even over the long haul, and most investors don't have a time horizon of 75 years or longer. But these examples show the effectiveness of long-term investing if you're fortunate enough to identify companies that have staying power to last for generations.

Editor's note: A previous version of this article incorrectly stated that Sears, Roebuck declared bankruptcy. The author and the Fool regret the error.