Marijuana in a bag. (Getty Images)

DENVER — In a nondescript industrial park in this city's Montbello neighborhood, employees at Medicine Man Production are hard at work harvesting marijuana.

Wearing navy blue scrubs under bright industrial lights, workers toil in 40,000 feet of cultivation space, picking through mature plants with fuzzy flowers so large their stems double over with the weight. After harvesting, the flowers are dried, processed, packaged and sold for as much as $330 per ounce.

It's that profit, as well as the growing legalization of marijuana for recreational use, that has caused Medicine Man and other marijuana cultivation facilities and retail shops to spring up in this Denver neighborhood – so much so, in fact, that residents often refer to the area as "Potbello."

"The canopy is where the money is," says Brett Roper, founder and CEO of Medicine Man Technologies, which started trading publicly this year on the over-the-counter market as a cannabis-industry consulting business.

Marijuana is a profitable business but comes with tight regulations as state governments legalize the industry. Medicine Man Production is privately held, but some of its owners also own a minority position of the publicly traded Medicine Man Technologies. Medicine Man Technologies earns profit by selling equipment designs and working with marijuana growers, but it doesn't touch or sell the plants – that's the role of Medicine Man Production.

The complex nature of this budding industry – legalized by some states but not the federal government – adds business and political complications to the space that's arguably one of the riskiest in the world for investors.

"There is a tremendous amount of homework to do," says Morgan Paxhia, co-founder and managing director at cannabis hedge fund Poseidon Asset Management. "But, at the same time, we don't want to turn people off from something that could be a huge winner. There's no other marketplace that's offering this much growth in the world."

Retail sales of legal marijuana in the United States rose from $3.4 billion in 2014 to $4.8 billion last year, says Matt Karnes, founder of cannabis industry financial analysis and research firm GreenWave Advisors. Based on the anticipated trajectory of legalization, the firm expects that figure could hit $25 billion by 2020.

Medicine Man Technologies is one of dozens of public marijuana-related companies. In the U.S., most of them are ancillary businesses – social media, lighting, consulting, facility development and delivery and security services. One exception is California-based Terra Tech, whose shares got the Security and Exchange Commission's blessing to trade despite its plans to grow and sell marijuana.

Most public marijuana companies trade in the over-the-counter markets, which are less liquid, transparent and regulated than large markets such as the Nasdaq composite. Many went public through a process called reverse mergers and make heavy use of convertible debt, both of which can lead to shareholder dilution. The industry also doesn't have widespread access to the U.S. banking system and faces restrictions on advertising. The SEC has warned investors about potential fraud in the industry.

"If you're talking about public companies, buyer beware," Roper says. "Never invest more than you can afford to lose."

There are some exceptions to the sea of over-the-counter penny stocks. The largest company that works with biological, as opposed to synthetic, marijuana is U.K.-headquartered biotech company GW Pharmaceuticals (ticker: GWPH), which has a market capitalization of $1.74 billion and is licensed to grow marijuana plants by the British government. The company's shares are up 80 percent this week on positive results from U.S. Food and Drug Administration trials on its cannabis-based epilepsy drug, Epidiolex.

Most are much smaller, though. Medicine Man Technologies has a market capitalization of $23.7 million, while Terra Tech has a valuation of $42.8 million.

That leaves investors to weed through a large field of penny stocks or sit on the sidelines until the legal ambiguity clears up.

An uncertain future. While marijuana-based companies are available on public stock exchanges, there are some – such as Hilary Bricken, an attorney with Seattle-based Harris Moure who writes about cannabis law – who say investing in marijuana-related stocks is technically illegal.

In theory, Bricken says, investors could face prosecution under the Controlled Substances Act. Repatriation to the U.S. of money earned from pot stocks in Canada, where cultivation for medical use is federally legal, could also violate U.S. drug trafficking and money laundering laws, she says.

The SEC, which has granted the public trading, is tasked with protecting shareholders, not enforcing drug laws. While the risk of an individual investor going to prison is extremely unlikely, it remains in the realm of possibility, Bricken says.

But even if agents started raiding direct cannabis companies and ancillary businesses, it would be taking things to the extreme to go after investors — even direct investors in the companies, much less those who have invested through the market, says David Feldman, a partner at law firm Duane Morris, which represents companies in the industry. For those who buy stocks in the market, "it would be extremely remote to imagine any authority coming in," he says.

Paxhia says the collusion argument shouldn't apply to ancillary companies whose products can also be used by other industries, or those whose revenues are isolated from the sale of cannabis. He adds that if the federal government was going to take issue with repatriating earnings, it would have already done so in relation to GW Pharmaceuticals.

However, a murkier area is Canadian public companies that have U.S. cultivation operations, which Poseidon won't invest in because it is confusing from a legal standpoint, he says.

There is also a risk that a new U.S. administration after the November presidential elections could put the brakes on states' legalization efforts, says Alan Brochstein, founder of subscription service 420 Investor. But he says the chances of a federal rollback are lessened now that the most vocal proponent, New Jersey Gov. Chris Christie, has dropped out of the race and because states are pulling in a lot of tax money from legal marijuana.

How to invest. Investors who do want to take the plunge should identify subsectors within the industry that are sustainable as laws change, Karnes says.

If marijuana is legalized federally, Scott Greiper, president of cannabis industry consultancy Viridian Capital Advisors, thinks the biotech space would benefit the most. Current law makes medical research very difficult. Other areas that stand to grow are infused products, cultivation and retail, real estate and software, Greiper says.

The health and wellness part of the industry – such as topical oils for arthritis – could be a blockbuster, says Frank Lane, president of CFN Media, a cannabis-industry media and advertising network.

Karnes points to DigiPath and Signal Bay, which are involved in lab testing that will be increasingly required as the industry matures, he says.