Image source: Heartware International.

Monday was another bad day for the stock market, with the only consolation for investors being that the day's losses weren't as bad as what they suffered on Friday. Ongoing concerns about the potential impact of the U.K.'s impending departure from the European Union weighed on stocks across the globe, and the realization that collateral damage could spread not only across the European continent but to other regions of the world as well was sobering to those who had hoped that the Brexit vote would have a more isolated effect. Major market benchmarks fell as much as 2.5%, and the S&P closed right at the 2,000 level. Yet some stocks managed to avoid the downdraft and post substantial gains. Among the best performers were Heartware International (NASDAQ: HTWR), GW Pharmaceuticals (GWPH), and Randgold Resources (NASDAQ: GOLD).

A big buyout lifts Heartware

Heartware soared 93% after getting a buyout bid from medical device giant Medtronic. Under the deal, Medtronic will pay $1.1 billion in cash for the maker of minimally invasive miniaturized circulatory support technologies. Heartware shareholders will receive $58 per share in cash, and Medtronic hopes that the purchase will expand its exposure to potential treatments for heart failure. In particular, Medtronic called out the success of the flagship HVAD system, which is the world's smallest ventricular assist device that allows patients to recover more easily from surgical procedures. For Medtronic investors, the deal isn't expected to put downward pressure on earnings per share and should help with revenue growth. For Heartware, the huge premium allows investors to recover only some of their losses in the stock since mid-2015, which stemmed from adverse events in trials of its next-generation MVAD heart pump.

This epilepsy treatment won't get lost in the weeds

GW Pharmaceuticals climbed 6% in the wake of its announcement that its Epidiolex treatment for Lennox-Gastout syndrome, a rare form of childhood-onset epilepsy, produced positive results in a phase 3 clinical trial. The trial achieved its primary endpoint of significantly reducing the monthly frequency of drop seizures, adding to encouraging results in March for the drug's use in treating Dravet syndrome. The biopharmaceutical company is best known because its proprietary product platform focuses on cannabinoid therapeutics, making it a favorite stock among investors seeking to profit from the increasing acceptance of marijuana. GW is also doing another phase 3 trial trying various doses of Epidiolex, and separate trials for treatment of Tuberous Sclerosis Complex and infantile spasms could add even more indications for the drug candidate's use.

All that glitters is gold

Finally, Randgold Resources gained 6%. Gold prices have performed strongly during the Brexit crisis, and Randgold in particular earned the attention of analysts at Goldman Sachs. The financial giant boosted its target gold price for the second half of this year and for next year, and it cited a low interest rate environment in Europe and the U.S. as supporting higher gold prices overall. Goldman also said that Randgold was among the best stocks in the gold mining industry, pointing to higher returns on capital and low all-in sustaining costs. If gold does well, then Randgold is in a good position to benefit from favorable conditions.