Thus far, 2019 has been a tale of two halves for the marijuana industry. In the first quarter, cannabis stocks were practically unstoppable, with the Horizons Marijuana Life Sciences ETF, a basket of more than four dozen pot stocks of various weightings, rising by roughly 50% and 14 well-known weed stocks surging by no less than 70% in a three-month span.

Meanwhile, the second quarter was sort of a canna-bust. Inclusive of dividends paid, the Horizons Marijuana Life Sciences ETF declined by 13%, and 36 of the 58 qualifying pot stocks I follow (qualifying in the sense that they traded during the entirety of the second quarter) moved lower by a double-digit percentage. That's basically two-thirds of all major marijuana and ancillary pot stocks losing at least 10% in three months.

A handful of dried cannabis buds lying atop a messy pile of cash.

Image source: Getty Images.

These marijuana stocks bucked the trend in Q2 and headed higher

The bright spot is that 15 pure-play and associated cannabis stocks bucked the trend. Below you'll find these top-performing marijuana stocks from the second quarter, along with their corresponding gains, followed by a brief discussion as to why some of these companies led the way in the previous quarter.

  • Zynerba Pharmaceuticals (NASDAQ:ZYNE): Up 150%
  • MediPharm Labs (OTC:MEDIF): Up 58%
  • Innovative Industrial Properties (NYSE:IIPR): Up 51%
  • Valens GroWorks: Up 48%
  • Shopify (NYSE:SHOP): Up 45%
  • Neptune Wellness Solutions (NASDAQ:NEPT): Up 36%
  • EnWave: Up 33%
  • Planet 13 Holdings: Up 26%
  • Scotts Miracle-Gro (NYSE:SMG): Up 25%
  • 22nd Century Group: Up 22%
  • Constellation Brands (NYSE:STZ): Up 12%
  • Cara Therapeutics: Up 10%
  • Flower One Holdings: Up 10%
  • GW Pharmaceuticals: Up 2%
  • Flowr Corp.: Up 1%

These 15 marijuana stocks represent the roughly 1 out of 4 weed stocks that increased in value during the previous quarter. Now let's look at what worked so well for these companies.

Two miniature baskets, with one holding a cannabis flower and the other holding an assortment of cannabis oils.

Image source: Getty Images.

Having a brand name went a long way in the second quarter

Perhaps the first thing that really stands out from this second-quarter data is that having a brand name, as well as core operations that aren't tied to the marijuana industry, was the key to a solid performance.

For example, Shopify, which supplies point-of-sale software to Quebec and select individual cannabis growers in various provinces, rose 45% in the second quarter. Shopify is expected to "see the green" in the years to come as marijuana companies lean on its sophisticated e-commerce platform to drive sales and improve the efficiency of their supply chains. Yet marijuana likely remains a relatively small component of Shopify's sales, meaning big gains in other industries thrust this popular software provider (and its revenue) higher.

Constellation Brands, which gains its association with pot stocks via its 37% equity stake in Canopy Growth, gained a healthy 12% in the second quarter after reporting solid operating growth from its alcohol brands. Despite Canopy's 670-million-Canadian-dollar loss in fiscal 2019, resulting in a $106 million charge for Constellation (that's in U.S. dollars), the company still managed to boost beer shipments by 5.4% and grow sales by a little over 2% in its first quarter. Constellation Brands' earnings-per-share outlook for the year also rose modestly.

Lawn and garden expert Scotts Miracle-Gro also dazzled with an uncharacteristically strong 25% gain in the three-month period. Even though Scotts Miracle-Gro's subsidiary Hawthorne Gardening, a supplier of hydroponics, lighting, soil, and nutrient solutions for the marijuana industry, has struggled, investors have kept in mind that the company's core lawn and garden segment for residential and commercial clients still represents north of 85% of total sales.

In other words, having exposure to cannabis is great, but having a fallback business is even better when you're a brand-name company.

A person holding a vial of cannabidiol oil in front of a cannabis plant.

Image source: Getty Images.

Anything involving CBD or CBD extraction was hot, hot, hot!

As was the case with the best-performing marijuana stocks in the first half of 2019, the second quarter saw cannabidiol (CBD) extraction-service providers and CBD-based drug developers soar in value. CBD is the nonpsychoactive cannabinoid best known for its perceived medical benefits.

CBD-focused drug developer Zynerba Pharmaceuticals was, hands down, the best marijuana stock in the second quarter and first half of the year. Zynerba's lead product, a transdermal CBD gel known as Zygel, is being tested in late-stage trials for Fragile X Syndrome and will be looked at closely for autism spectrum disorders. Not a lot is known about CBD's potential medical benefits, but the American public and investors appear convinced that it could be an inexpensive wonder drug for a host of ailments.

Gaining access to CBD has also been a hot-button investment in the second quarter. Whereas retailers of CBD products are often the point of focus, it's extraction-service providers that have quietly delivered the strongest returns.

MediPharm Labs, which had the second-best performance of any marijuana stock in the second quarter, signed an 18-month deal with Cronos Group in May that's worth at least $30 million and may increase to $60 million over 24 months. In return for providing Cronos with private-label concentrates, Cronos will use MediPharm Labs' Barrie, Ontario, extraction facility as a preferred partner for its processing needs under a separate agreement.

Meanwhile, Neptune Wellness Solutions has been racking up major extraction deals like they're going out of style. On June 7, Neptune signed a three-year deal with Tilray to provide extraction for 120,000 kilos of total hemp and cannabis biomass. Five days later, it landed the largest extraction deal announced to date: a 230,000-kilo hemp and cannabis biomass agreement spanning three years with The Green Organic Dutchman.

These extraction-service providers may not be consumer-facing names, but they could be the smartest way to play the rise of CBD.

A hybrid greenhouse with flowering cannabis plants.

Image source: Getty Images.

Niche players thrived

A final prominent theme in the second quarter among top performers was that niche players thrived. Companies that have little or no existing competition, at least in the sense of being publicly traded players, tended to do very well.

For instance, cannabis real estate investment trust (REIT) Innovative Industrial Properties is the best-known (and only) way to play marijuana as a real estate investment. As a cannabis REIT, Innovative Industrial Properties will acquire assets (grow farms and processing sites) then lease these assets out for long periods of time. Not only does it reap the rewards of higher rental income when it acquires new properties, but it also passes along a 3.25% annual rental increase and a 1.5% management fee based on the rental rate, thereby providing modest organic growth.

Since the year began, Innovative Industrial Properties has doubled the number of properties it owns to 22, and during the second quarter, it announced yet another increase to its quarterly dividend. Now paying out $0.60 per quarter, the company has increased its quarterly payout a cool 140% in just one year.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.