BOSTON (TheStreet) -- The best-laid plans can often go awry. Sometimes, when they do, the result can be pure profit.

Millions have been made from accidental discoveries, proof of the adage that sometimes it is better to be lucky than good.

Coca-Cola

(KO) - Get Report

and

Pepsi

(PEP) - Get Report

were birthed as medicinal remedies.

Plastic

was first synthesized in a failed effort to reproduce the shellac once made from beetle husks and Charles Goodyear, as in

Goodyear

(GT) - Get Report

, made no secret that his revolutionary process for

vulcanized rubber

was discovered randomly.

Here are 10 other big products that went from being missteps to life-changing discoveries:

Viagra

Pfizer

(PFE) - Get Report

chemists were developing a pill to treat cardiovascular ailments. In 1991 something came up (literally) that sidetracked those efforts: Test subjects exhibited a rather virile side effect to the treatment.

The pill, later named Viagra and approved by the FDA in 1998, proved a bust in terms of treating heart disease. But the unexpected benefit pumped up its maker's bottom line and set the stage for a brand-new industry.

Today, drugs to treat erectile dysfunction command more than $5 billion a year in sales globally. Of that take, Viagra accounts for about $1.9 billion, but its chief rival in the space,

Eli Lilly's

(LLY) - Get Report

Cialis, closing in on parity.

Minoxidil

The discovery of Viagra is only one of the great accidental discoveries to cheer middle-aged men.

For those battling a problem above the shoulders -- thinning and falling-out hair -- the drug Minoxidil, branded by

McNeil-PPC

, part of the

Johnson & Johnson's

(JNJ) - Get Report

family, as Rogaine.

The drug-laced foam was synthesized after Upjohn researchers realized that a blood pressure drug, Loniten, had the side-effect of thickening and darkening hair. Upjohn was later sold to Pfizer and Rogaine was among the brands shipped over to Johnson & Johnson when the company sold its consumer-focused division in 2006.

Applied to the scalp, the drug is not touted as a full-on cure for baldness; its maker does boast of studies where 85% of male test subjects regrew hair after four months of twice-daily use.

Also used by women suffering from hair loss, Rogaine sells roughly $60 million a year, according to health care analysts at

Information Resources

. Earlier this month, the Food and Drug Administration approved a generic version made by

Perrigo

(PRGO) - Get Report

that is expected to hit shelves next year.

Corn flakes

As a Seventh Day Adventist, Dr. John Harvey Kellogg adhered to his faith's vegetarian diet as well as the teachings of the cultish, nutritional hardliner Sylvester Graham, the inventor of graham crackers.

In 1894, while employed by the Battle Creek Sanitarium in Michigan, he began experimenting with ways to make that restrictive diet more palatable and an inexpensive way to feed his charges.

Leaving some boiled wheat unattended, it went stale. Attempting to salvage it by rolling it into dough, Kellogg (aided by his brother Will) found that it tore into pieces and refused to hold a shape. Undaunted, they toasted the flakes and were pleasantly surprised by the result.

After a bit of trial and error, the brothers decided to use corn, instead of wheat, as the main ingredient. The result was deemed tasty enough by patients that Will founded a company bearing the

Kellogg's

(K) - Get Report

name to sell their corn flakes.

Dr. John, however, opted out of the venture, angered that his brother tampered with the healthful nature of the recipe by adding sugar to the mix. It should be noted that the elder Kellogg wasn't so much worried about obesity or bad teeth; as a staunch practitioner of sexual abstinence, he theorized that his corn flakes would suppress physical urges. Sugar, an aphrodisiac in his opinion, would undo that.

Further revolutionizing how the world eats breakfast, a patient at Kellogg's sanitarium, C.W. Post, used his own variation of the cereal to create his own company and a competing product, Post Toasties.

Microwave ovens

It is hard to imagine the hassle we all went through to reheat lunch or fill a bowl of popcorn before the advent of the microwave oven.

Your beeping buddy in the kitchen owes its existence to a

Raytheon

(RTN) - Get Report

engineer who, back in 1945, was experimenting with a device called a magnetron, a microwave -emitting tube used as part of military radar systems. As he tinkered with the device, he noticed a candy bar in his pocket melting.

Suspecting the radiation was cooking his snack, the engineer set out to test the theory. In doing so, Percy Spencer discovered a revolutionary way to cook and goes down in history as the first person to make microwaved popcorn.

Built in 1947, Raytheon's first take on the oven was targeted at commercial uses -- it was more than 5 feet tall and cost roughly $5,000. In 1967,

Amana

, a Raytheon division, began selling sub-$500 versions intended for at-home kitchen use.

Artificial sweeteners

The discovery and subsequent marketing of saccharin as an artificial sugar substitute might never have happened if there had been an "Employees Must Wash Hands" sign nearby.

In 1879, a chemist by the name of Constantin Fahlberg was working with coal tar. He finished his day's work and apparently headed home for dinner without stopping to wash up.

While dining with his wife, the muck-handed scientist noticed that everything he ate had a distinctly sweet taste. Connecting the dots, he realized his hand residue was the source.

Saccharine's cousin, aspartame, has a similar accidental history. It was discovered in 1965 by chemist James M. Schlatter, who was trying to fashion an anti-ulcer medication. It was later developed and branded as NutraSweet by

Monsanto

(MON)

before being sold for $440 million to

J.W. Childs Equity Partners

, a Boston-based private investment firm, in 2000.

Silly Putty

Silly Putty

, that beige blob beloved by kids, is another winning product that snatched victory from the jaws of defeat. Since 1950, 300 million eggs of the stuff -- roughly 4,500 tons -- have been sold, according to Crayola, which now owns the brand.

The widely-cited version of Silly Putty's creation (for which there are conflicting accounts) credits James Wright, an inventor employed by

General Electric

(GE) - Get Report

, with discovering the rubbery mix of boric acid and silicone oil in 1943. Like many chemists during World War II, he was seeking a synthetic rubber substitute amid a shortage of the real stuff. As fake rubber, the goo was a failure; as Wright shopped around his creation, however, a toyshop owner came up with the idea to market it to kids.

Play-Doh

Another kid-friendly concoction,

Hasbro's

(HAS) - Get Report

Play-Doh

, also hit the marketplace after failing in its original intent -- to be a cleaning substance for wallpaper.

Created in 1956 (and patented in 1965) by Noah McVicker and Joseph McVicker, the brothers had initially cast aside their invention. Then, inspiration struck when a teacher casually mentioned her dissatisfaction with the hard, tough-to-shape clay her students used.

The soft, pliable wallpaper product began its new life when they offered to supply schools in the Cincinnati area with their squishy stuff. It was such a success that department stores took notice, leading to the formal branding and marketing of Play-Doh.

A variety of accessories have helped add to the millions of tons sold over the decades. Among them, the Play-Doh Fun Factory introduced in the 1960s, the Fuzzy Pumper Barber & Beauty Shop and a

McDonald's

(MCD) - Get Report

play set.

Warfarin

Warfarin, sold by

Bristol Myers Squibb

(BMY) - Get Report

as Coumadin, a blood thinner used to stave off strokes and heart attacks, was a rat poison until its lower-dose benefit to humans was stumbled upon.

The actual discovery of Warfarin was itself surprising. Back in 1933, a Wisconsin farmer dropped in on Professor Karl Paul Link of the University of Wisconsin-Madison's School of Agriculture and asked for his help in figuring out why local cows were dying.

The suspect was the type of hay the cows were eating and the type of sweet clover added to the feed. It took Link and his lab until 1941 to fully identify and isolate the powerful anticoagulant killing the cattle.

In marketing the chemical as a rat poison, the name Warfarin was chosen as a shout out to the

Wisconsin Alumni Research Foundation

, an organization that helps process, patent and commercialize inventions by UW-Madison faculty and staff.

Phosphorous

Penicillin

, as most schoolboys can tell you, was an unexpected byproduct of moldy bread. Less likely to be discussed in a classroom is that the chemical phosphorus was first isolated by a would-be alchemist who thought he could chemically extract gold from urine, and instead wound up with a glow-in-the-dark white powder.

The versatile chemical (now yielded from far less nasty sources) is used today in toothpaste, shampoo, pesticides and fertilizer.

The red tips of matches are made from the a type of Phosphorus, replacing the poisonous, potentially lethal "white" variety used in the 1800s.

Chocolate Chip Cookies

Famously, chocolate chip cookies were a failed baking experiment. Legend has it that in 1930, Ruth Graves Wakefield, owner of the Toll House Inn in Whitman, Mass., was trying to concoct a chocolate dessert and was pleasantly surprised when the chunks failed to melt into the batter as planned.

The details of this happy accident are sometimes disputed, with an argument made that the accomplished cook's discovery was more premeditated than accidental. What is not disputed, however, is that billions of chocolate chip cookies have been consumed around the world since that fateful day.

Nestle, the Swiss-owned company that originally sold Wakefield's choice of chocolate bits and owns the Toll House trademark, has since grown into a global giant, posting sales of $105 billion last year.

-- Written by Joe Mont in Boston.

>To contact the writer of this article, click here:

Joe Mont

.

>To follow the writer on Twitter, go to

http://twitter.com/josephmont

.

>To submit a news tip, send an email to:

tips@thestreet.com

.

RELATED STORIES:

>>12 More Things Invented by Accident

>>10 Brand Names Gone, But Not Forgotten

10 Most Over-the-Top Product Placements

Follow

TheStreet

on

Twitter

and become a fan on

Facebook.