They all develop drugs. One of them sells fossil fuels. These 20 Massachusetts-based companies, which were ranked as of Friday Dec. 16, had the highest stock gains in 2022. They represent a variety of industries. Public companies generally suffered this year, with stocks losing a lot of their value throughout the year. Only 70 of the 354 Massachusetts-based public corporations with market capitalizations greater than $100,000,000 saw their stock prices rise so far in 2018. Since Jan. 1, the median company on this list has seen its stock prices drop 25%. However, based on past years' lists of top stock-gainers, it is often the case that the good times may not last for many companies listed as top stock-gainers in 2022. Aspen Aerogels (NYSE : ASPN), which was the second-highest performing company last year, is now 13th. In February, the deal that took Houghton Mifflin Harcourt Co. private, which was the top-performing company on last year’s list, saw it become textbook publisher Houghton Mifflin Harcourt Co. Moderna Inc. (Nasdaq : MRNA), last year's third-ranked company with a 146% stock gain, is now in the middle of the list with a 24% decline as of last week.