It's always exciting to see a hot new technology trend, especially if you're an early investor in companies on the leading edge. All that excitement makes it easy to get swept away by increasingly hyperbolic optimism and flashy headlines. "Transformative!" "Life-changing!" "Shifting the paradigm!" "A revolution in innovation!"

While the buzz lasts, you can get incredible returns. Just ask anyone who rode the dot-com bubble skyward in 1999 -- unless they rode it back down the following year, of course.

That's the problem with market optimism: It never lasts. Sometimes high-tech optimism sweeps the entire stock market upward with visions of a sci-fi future where everyone's a millionaire with a robot butler, while other times only the stocks of a few robot-butler-manufacturing companies get caught in the updraft. Either way, stock prices gallop away from their financial fundamentals, the sky-high valuations eventually prove unfounded, and years of gains are lost as people realize that the revolution they were promised is taking too long to arrive.

It's important to understand how this happens, what it means for technology and society, and what you can do to avoid losing your shirt in the stampede. With that in mind, let's examine some of the great tech bubbles in American history to see what lessons they hold for us regarding today's market.

Raging tech bulls of the ancient past
Every great bull market in America's industrial history has been built on a tech bubble that popped before the technology was fully mature. A bull market in the 1860s coincided with the growth of the railroads. The Roaring '20s got their roar from mass production and new audio-visual communication technologies. A two-decade bull market at the end of the 20th century rose first on computing and then on connected computing through the Internet. In each case, the technology really did change the world, but the changes did not fully take hold until the bull had already worn itself out.

The railroad boom lasted from 1860 until the Panic of 1873. During this period the United States' total track-miles grew from 30,000 miles to about 70,000 miles, and railroad stocks grew to comprise 40% of the entire stock market's capitalization. Then the panic hit. The New York Stock Exchange closed down for 10 days as a result of the crash, and thousands of businesses failed, including 55 major American railroads. Another railroad bubble formed in the 1890s with similar results.

Despite these repeated losses of confidence, the American rail system continued to grow until 1916, when it reached an all-time high of 254,000 track-miles and was carrying two-thirds of all American freight.

The years that changed America -- eventually
Investors in the Roaring '20s had a lot of exciting developments to pour their money into. Henry Ford's assembly line had changed the way American factories operated, making not just car ownership, but "stuff" ownership possible for millions of families. The electrification of America gave consumers a far wider variety of interesting and interactive stuff to buy. Throughout the decade, more than $4 billion in loans were made available to consumers, many of whom bought new Ford (F 6.10%) Model Ts on credit so they could drive to newly built department stores and buy even more mass-produced stuff on credit. Radio and film also became hugely popular among the new consumer class

No stock symbolized the rise of this new economy quite like RCA, an offshoot of General Electric (GE 1.44%) that built a monopolistic presence in the radio industry. Between 1921 and 1929, RCA's shares rocketed from $1 to $573. In 1928, the Dow Jones Industrial Average (^DJI 0.67%) made the same mistake with RCA that it made with tech stocks in 1999 by adding the company to its roster a year before the bubble's peak. RCA went on to lose 95% of its value in the aftermath of the Crash of 1929, and the Dow's handlers remedied their mistake by removing RCA the following year, which is something we can't say of more recent tech additions.

The Crash of 1929 didn't stop the spread of electricity, which reached 99% of all American homes by 1956. Nor did it halt the growth of America's car culture: The number of registered passenger vehicles rose from 23 million in 1929 to 110 million in 1976 -- years before the Interstate Highway System had been completed. Likewise, all manner of electronic gadgets continued to gain popularity, enjoying their own bubble in the postwar years.

Dot-com doldrums
The dot-com bubble should be a little more familiar to modern market-watchers. We went from seeing Steve Jobs on the cover of Time in 1982 to hearing Today show anchors ask, "What is the Internet?" in 1994. During this period, the proportion of U.S. households that had personal computers increased from 8% to 23% (although few were connected to the Internet). The Nasdaq (^IXIC 1.11%) rose from 188 to 792 for a 320% gain.

Then we went from "What is the Internet?" to "I gotta buy some stock in this Internet!" Nasdaq 792 rocketed to Nasdaq 5,000 by March 2000. Then the crash came, and to this day the Nasdaq remains nearly 40% below its all-time peak.

And since the crash, Internet-connected devices have found a place in nearly every U.S. household. E-commerce generated $28 billion in sales in 2000; over the past four quarters it's been worth $217 billion.

A high-tech mousetrap -- just like the old one
Two of the best stocks on the market last year also happen to be two of the clearest examples of this phenomenon on a smaller scale. Investors in 3D Systems (DDD -1.97%) and Stratasys (SSYS -1.95%) enjoyed multibagger returns last year, even though actual 3-D printer sales are still measured in the thousands and total spending on 3-D printers is only estimated to have been $1.5 billion last year. Along the way, article after article has promoted 3-D printers as nothing less than the Star Trek replicator made real, waiting for your command to whip up some "tea, Earl Grey, hot."

Since it has come up so many times before, let me point out that The Motley Fool has previously recommended buying shares in both companies, but I neither own shares nor have shorted shares in either one. I'm grateful for the opportunity to publish an opinion that runs contrary to that of the official newsletters and many fellow Fools in my effort to educate readers. Now, back to the show...

You can see the interest in 3-D printing rising by tracking the number of mentions 3D Systems has gotten on Fool.com. In 2007, there were two passing mentions, and the stock was flat for the year. There was only one article written about 3D Systems from 2008 to the end of 2010, and until a late-year post-earnings surge tacked on a quick double, its stock was flat the entire time. We started to get on board the bandwagon in 2011, publishing 23 articles as we watched the stock soar toward another double and then crash into another flat year. 2012 was 3-D printing's coming-out party, and 3D Systems headlined the festivities with 149 mentions. We're hardly the only people writing about this technology, but an Internetwide news search provides similar results. What has suddenly changed?

Last year the market passed "what is 3-D printing?" and is now well into the "I gotta buy some stock in 3-D printing!" phase, despite (or perhaps because of) the fact that most investors have, at best, a vague understanding of how 3-D printers actually work and what their value proposition is for manufacturers and consumers. Total 3-D printing industry revenues are expected to double from current levels by 2016. If these two companies' top and bottom lines increase at the same rate but nothing else changes, you'll still be holding stocks with P/Es around 50. That won't stop a torrent of breathless articles about the "maker movement" and how it's going to make mass production obsolete. That might happen -- but not in the next few years. The technology is simply too slow, cumbersome, and expensive on a unit-by-unit basis. That will change, but change takes time. Hyperbole works right now. "Shifting the paradigm!" "Printing outside the box!"

Keep your eyes on the prize
In bubble after bubble, investors rush in expecting the world to change overnight -- and then rush out when they remember that real change takes time. When it comes to transformative technologies, you rarely wind up investing in the full transformation unless you jump in after the bubble pops. There hasn't been another marketwide bull rush yet, because nothing on the scale of personal computers and the Internet has stepped up to become the next big thing, so all we can do is watch for small, contained bubbles and make sure we don't fall prey to the excessive hype surrounding them.

I still believe 3-D printing has the potential to change the world. I also believe it's possible for 3D Systems and Stratasys to be the companies leading that change. But it's also possible that they won't. The problem is that 3-D printing companies' stock prices are rising too far in advance of the industry itself. The same thing caught up with the market in 1873, 1929, and 2000, as well as a few occasions in between. It's great to find a hot tech stock before it takes off, but if it's already up in the air, you have to seriously consider how long it can stay up. These two companies might keep soaring all year, or they might crash tomorrow. Are you willing to risk the crash? And would you be able to jump off in time?