The stock market did something on Wednesday that it hasn't done very often during recent months: give up substantial gains during the day to finish with a modest loss. Major market benchmarks had been up as much as 1% earlier in the session, but news from the Federal Reserve that it intends to change the way that it handles its balance sheet seemed to shift what had been positive sentiment toward the economy during the morning. Yet some stocks still managed to do well, and American Railcar Industries (NASDAQ: ARII), Landec (NASDAQ:LNDC), and Quaker Chemical (NYSE:KWR) were among the best performers on the day. Below, we'll look more closely at these stocks to tell you why they did so well.

American Railcar jumps on rival's strength

Shares of American Railcar Industries finished 5% higher in the wake of positive news from one of its primary competitors in the railcar business. Greenbrier reported favorable fiscal second-quarter results Wednesday morning, pointing to signs of stabilization in what has been a challenging market environment over the past couple of years. For its part, American Railcar has held its own, having reported solid earnings in its most recent quarterly report that give the stock an extremely attractive valuation. Some fear that earnings will deteriorate, but if American Railcar can ride the same positive trends that its main competitors appears to be using to its advantage, then a further recovery for the stock could come soon.

Tank car with mountain backdrop.

Image source: American Railcar Industries.

Landec gives a good report

Landec stock climbed 12% after the company reported its fiscal third-quarter results late Tuesday afternoon. The company, which specializes in packaged fresh vegetables as well as specialty packaging and formulation for medical devices and pharmaceuticals, said that it reversed a year-earlier loss with earnings of $0.13 per share during the fiscal third quarter, with a 5% rise in sales stemming largely from its Lifecore segment. Challenges in the food segment remain, but CEO Molly Hemmeter said that a move toward higher-margin vegetable salad products should help the segment do better, and record sales for Lifecore are putting Landec in position for even stronger growth going forward. Difficult weather conditions in California could lead to reduced earnings in the short run, but Landec is working hard at long-term initiatives that should support its business for years to come.

Quaker gets friendly

Finally, shares of Quaker Chemical rose 7%. The Philadelphia-based chemical company said that it had reached a deal with privately held Houghton International to combine, forming a larger player in the business in what the companies called a "highly complementary transaction." Under the terms of the deal, Houghton will receive $172.5 million in cash along with a 24.5% stake in Quaker, making Houghton owner Hinduja Group the largest shareholder in Quaker going forward. The companies believe that the combination should produce "one of the world's most expansive metalworking platforms," with specialty products that should make it extremely attractive to customers. With financing secured and prospects for $45 million in cost synergies, Quaker shareholders are pleased with the move to grow the company's business.

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.