Tilray's wild stock market ride underlines the enormous potential investors see in the burgeoning marijuana sector -- and of the volatility in the segment.

A spike in the Canadian cannabis company's stock price in recent days has made it the most valuable publicly traded pot company on the planet, with a market capitalization of nearly $20 billion. CEO Brendan Kennedy helped power the surge on Wednesday by touting the company's growth prospects along with others in the cannabis sector. The company also got a boost this week when the U.S. Drug Enforcement Administration gave it the green light to import medical marijuana for a clinical trial in California.

But the company's stock gave up much of its gains Wednesday, ending up 38 percent after soaring as much as 90 percent earlier in the session. The sharp swings also led Nasdaq, where Tilray is listed, to briefly halt trading in is shares. The shares, which closed at more than $214 for the day, then continued to lose ground in after-hours trading.

Get Breaking News Delivered to Your Inbox

Despite the turnaround, it's been a remarkable few months for Tilray. Since its U.S. market debut in July, its stock has surged more than 1,000 percent, giving it a larger valuation than many mainstream names, including American Airlines and Clorox, Bloomberg News noted.

Tilray's competitors were also traveling higher, with Cronos Group up 22 percent Wednesday, Canopy Growth ahead 2.4 percent percent and Aurora Cannabis climbing 8.6 percent.

Investors are not the only ones joining the pot party, with beverage maker Coors last month saying it would partner with a Canadian cannabis producer to develop a drink containing marijuana, and Coca-Cola on Monday confirming it was looking at cannabis-infused drinks as a potential business.

On Tuesday, Kennedy told CNBC's Jim Cramer that he anticipates another country would join Canada is legalizing marijuana in 2019, saying "it's not about Canada -- it's about all the countries that follow."