Wednesday was a bad day for the stock market, with major benchmarks falling 0.5% or more. Investors chose to pay closer attention to the state of trade relations between the U.S. and its key trading partners, and ongoing concerns about potential further fallout from the U.S. row with Turkey contributed to declines. Poor performance in commodities also added to weakness in several key sectors of the stock market. Yet even on a bad day, a few companies managed to post solid gains. Chipotle Mexican Grill (CMG 0.40%), Tilray (TLRY), and PetIQ (PETQ -0.42%) were among the best performers. Here's why they did so well.

Chipotle looks tasty to analysts

Chipotle Mexican Grill stock jumped nearly 7% after the Mexican food chain got a good review from analysts at a well-known Wall Street institution. Morgan Stanley raised its rating on Chipotle from equal weight to overweight and boosted its price target from $413 per share to $600. Institutional investors like the steps that new CEO Brian Niccol has taken, using his experience from Taco Bell to implement fresh initiatives that are gaining traction. With new menu experiments, many think that Chipotle can appeal to a broader audience, and that could produce growth that has previously gone untapped for the restaurant company.

Plate with tostadas on a table next to a Chipotle flyer.

Image source: Chipotle.

Positive news for a peer lifts Tilray

Shares of Tilray soared 20% as investors boosted the prices of stocks across the marijuana industry. The Canadian company rose after spirits and beer giant Constellation Brands said it would invest another $4 billion in pot peer Canopy Growth, showing the interest among major companies in taking advantage of rapidly opening marijuana markets in North America. Tilray went public less than a month ago, but some believe that it could be the next acquisition target in the pot space, whether the buyer turns out to be a competitor like Canopy or a different player in the tobacco or spirits industries.

PetIQ barks about its earnings

Finally, PetIQ stock picked up 10%. The provider of medications and veterinary services for pets said that revenue nearly doubled from year-ago levels, producing impressive levels of income and leading to stronger guidance for full-year sales. PetIQ has expanded rapidly in order to take advantage of unprecedented demand for high-end products and services in the pet space, and a rising emphasis on the e-commerce channel has paid off with even more dramatic growth there. As PetIQ's network spreads across the country, the company expects to learn from its experience and improve its service levels further. For those who believe in the rising popularity of household pets, PetIQ is a good way to play the strong trend.