This article was updated on October 20, 2017, and originally published on May 16, 2017.

Marijuana legalization might have you thinking it makes sense to buy marijuana stocks as an investment. However, the marijuana market is only beginning to develop, and most marijuana stocks that can be bought on stock exchanges aren't earning a dime in profit yet.

Big market, but big risk

So far, 29 U.S. states have legalized medical marijuana, and medical marijuana is already legal in Canada. In 2018, additional U.S. states could approve pro-pot legislation and Canada could legalize recreational marijuana.

A person rolls a joint from a ziplock bag containing marijuana.

IMAGE SOURCE: GETTY IMAGES.

As the marijuana market emerges from the shadows, billions of dollars will transition from the black market to regulated markets.

According to Matt Karnes at GreenWave Advisors LLC, the marijuana market in California alone could exceed $7 billion by 2021, and based on states that have already legalized marijuana, the marijuana market nationwide could be worth $25 billion in 2021.

In Canada, cannabis could be similarly lucrative. Canadian bank CIBC estimates that recreational legalization could create a marijuana market in Canada valued between $5 billion and $10 billion, depending on volume.

Clearly, a lot of money is up for grabs, but unfortunately, it's not clear which companies will capture the lion's share of this opportunity. While many marijuana stocks have rallied sharply on the potential to profit from marijuana, the reality is that there are thousands of businesses elbowing each other for market share, and only a few of those companies trade on market exchanges.

Instead, most are bootstrapped by family or venture capital, or they trade on risky, unregulated over-the-counter stock markets. Stocks available on over-the-counter markets don't have to meet the strict regulatory requirements associated with major stock exchanges, including the New York Stock Exchange, and therefore, they're ripe for fraud.

Few marijuana stocks make the grade

The vast majority of marijuana stocks are still losing money, but an argument can be made that some of these companies are worthy of consideration.

For instance, GW Pharmaceuticals (GWPH) isn't a pure-play marijuana company, but it is developing medicines that are derived from marijuana cannabinoids.

Currently, the company's only commercial product is Sativex, a THC-based drug sold in Europe for use in multiple sclerosis patients with muscle spasms. However, a decision from the U.S. Food and Drug Administration on Epidiolex, an epilepsy drug developed from the cannabinoid cannabidiol, could be coming soon.

While Epidiolex could become a top-selling epilepsy drug someday, GW Pharmaceuticals' shares have skyrocketed since 2013, so a lot of Epidiolex's opportunity may be priced in already. GW Pharmaceuticals expects to officially file for Epidiolex's approval soon, so a go/no-go decision could come from the FDA next year.

GWPH Chart

GWPH data by YCharts

The Scotts Miracle-Gro Company (SMG 1.02%) is another intriguing back-door marijuana stock to consider buying. The company is best known for its fertilizers and pesticides, but it's invested a lot of money in hydroponics so that it can serve the marijuana market. As legalization drives marijuana volume higher and grow facilities ramp up their capacity, the company could significantly increase its hydroponic product sales.

The company's hydroponics revenue is up 160% this year largely because of acquisitions. But, even if you adjust back out those deals, revenue is still up 15% year to date. However, hydroponics is still a small proportion of Scotts Miracle-Gro's business, and seasonal volatility in demand for lawn and garden products could be a reason to approach Scotts Miracle-Gro's stock cautiously.

A pure marijuana investment investors might want to consider is Canopy Growth Corp. (CGC 15.03%) It's Canada's biggest medical-marijuana company, and acquisitions partnerships, including a deal with Snoop Dogg, may put it in a perfect position ahead of Canada's legalizing recreational marijuana.

Canopy Growth's story, however, isn't undiscovered. Its shares rocketed more than 200% higher in 2016, and they've doubled from their early 2017 lows. The company's $1.7 billion market valuation dwarfs the company's $37 million in trailing 12-month sales. Furthermore, Canada's marijuana industry suffered a blow to its reputation earlier this year when products were recalled due to the use of banned pesticides in marijuana grow facilities.

The regulatory agency Health Canada is implementing mandatory testing in response to the recalls, but the fiasco hints at the growing pains that companies like Canopy Growth are facing. Given its sky-high valuation, there's reason to avoid buying Canopy Growth shares.

Looking ahead

Surely, tens of billions of dollars in marijuana sales will turn some companies into big winners, but it's very possible that the companies that end up dominating this market aren't the ones that have seen their share prices shoot higher over the past few years. For that reason, investing in marijuana stocks is very risky, and most investors might be better off investing in other stocks until marijuana companies are more established.