Michael Bourque had never smoked pot until a bout of anxiety in his 40s. Discouraged by the side effects of the medicines he was prescribed, Bourque became intrigued by the potential benefits of marijuana.

At that time, in 2014, marijuana for medicinal purposes had yet to go on sale in Massachusetts. So, like many people before him, Bourque hit the streets. “I found a guy that looked like ZZ Top, and the next thing you know I’m doing a deal in a parking lot,” he said.

He tried it the old-fashioned way — smoking a joint — and hated it. So the longtime product development manager tore apart commercial pot vaporizers that are available on the market to find out how they worked, convinced he could make a device as consumer-friendly as a coffee machine.

Today, Bourque is the cofounder of CannaKorp Inc., a Stoneham company making a marijuana vaporizer that has an inevitable comparison to the instant coffee machines made by Keurig, where Bourque’s business partner was a longtime executive. The CannaKorp vaporizer is expected to debut early next year, just a few months after Massachusetts voters decide whether to legalize marijuana for recreational use.

Bourque is just one of the entrepreneurs angling to cash in on the emerging regulated pot industry, an odd parade of engineers, activists, black-market refugees, and even strait-laced business types who haven’t held a joint since college.

“We’re on the cusp of the next big industry,” said Scott Bettano, whose mobile app Social Hightargets marijuana enthusiasts. “How many people would have taken advantage of Prohibition if you were around?”

DINA RUDICK/GLOBE STAFF

A prototype of the CannaKorp marijuana vaporizer.

If put on the ballot and passed, the measure would make it legal for adults to possess and use small amounts of the drug by December. Retail sales could begin in January 2018.

The money at stake is huge. In Colorado, for example, a Denver Post analysis of tax collections estimated the recreational market at nearly $588 million in 2015 and the medical market at about $408 million. And in Washington state, the Liquor and Cannabis board estimated recreational and medical marijuana sales combined for $940 million last year.

Those sums can attract a lot of people with dreams of easy cash. But the regulatory hurdles for businesses handling the drug can be quite steep.

“We have serious conversations with folks who are getting into the industry to make sure they understand the challenges, and try to pour some cold water on these thoughts that it’s just a license to print money,” said Kris Krane, cofounder of 4Front Ventures, which provides investment and consulting services to marijuana businesses.

That’s why many upstarts are avoiding handling the cultivation and sale of the actual plant, in favor of related businesses, said Hilary Bricken, a Seattle lawyer who specializes in the sector.

For example, Apeks Supercritical Inc. of Johnstown, Ohio, makes machines that extract oils from plants, while PayQwick is a California company making an electronic payments processor for marijuana purchases.

“The people selling the pickaxes and the shovels — as usual, they’re the ones taking it to the bank right now,” Bricken said.

That’s where CannaKorp is aiming.

The company’s sleek, white-plastic vaporizer heats marijuana just enough to release the active compounds while stopping short of actually burning the plant. Users breathe in the vapors released through a canister, and the marijuana comes in small, single-use “pods” that are independently filled by legally authorized growers.

If that sounds a lot like the Keurig instant coffee machine, it’s no mistake. CannaKorp chairman Dave Manly was a longtime vice president at Keurig Green Mountain Inc. before retiring in 2014 and linking up with Bourque.

Manly recalled the reaction when they showed the machine to a focus group of potential customers. “People said, ‘Oh my God, how fast can I have one of those?’ Which is exactly what people said when they saw the Keurig,” Manly said.

CannaKorp is officially focused on the medical marijuana market. But executives acknowledge that legal recreational use has potential to expand their customer base.

“We’re a company that’s medically oriented,” Bourque said. “However, we know that the recreational market is going to go crazy over this, and we like that.”

The industry has also provided refuge for some entrepreneurs who are intensely familiar with the black market. That’s the case with Bettano, who launched Social High after serving a three-month sentence for possession with intent to distribute.

Bettano said he sold large amounts of marijuana for a partner in California after losing his job at a construction-services company during the financial collapse of the late 2000s.

“We were living very comfortably, but by no means was I Scarface. I wasn’t driving around in $100,000 cars or anything like that,” he said. “The bills were paid and we had some extra money to shop and make sure the kids had everything they needed.”

That ended in 2012, when police raided his New Hampshire home, finding about 15 pounds of marijuana. With a felony conviction on his record and his movements restricted during a yearlong probation, Bettano placed his next bet on social media.

Social High expects to reach 10,000 users in the coming weeks, which makes it small in the world of mobile apps. But Bettano said its fans are enthusiastic about having a digital space to find like-minded people in a not-yet-mainstream market.

“On Facebook, you’re connected with your friends, your family, your co-workers. And there’s a lot of people that come onto our app because it’s a safe place for them,” he said.

It’s anybody’s guess which businesses will thrive or fail in a wildly changing market like marijuana. But Bricken said early results have convinced her that old-fashioned business acumen will win out.

“It’s a huge mistake to think that cannabis is somehow special,” she said. “To the folks that do well, it could be a candy bar, coffee, widgets, whatever. When they realize that, they do much better.”