The stock market finished mixed on Tuesday, and although the Dow Jones Industrials still finished with a loss of more than 100 points, other major market benchmarks finished very close to the unchanged level on the day. Geopolitical pressure continued to hurt investor sentiment, and some bad news on the earnings front also cast a pall on trading during the regular session. Yet some stocks managed to post substantial gains, and Momenta Pharmaceuticals (NASDAQ:MNTA), Ally Financial (NYSE:ALLY), and Thermo Fisher Scientific (NYSE:TMO) 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.

Pharmacist with pills on a glass table.

Image source: Getty Images.

Momenta has its moment in the sun

Momenta Pharmaceuticals soared 25% after the biotechnology company won a lawsuit over alleged patent infringement. A Delaware federal district court found that four patents held by Teva Pharmaceutical (NYSE:TEVA) were invalid, opening the door for Momenta to offer its own competing version of a key drug. Momenta CEO Craig Wheeler provided details in his praise of the decision, noting that it "further bolsters our confidence in the potential for us to offer multiple sclerosis patients a more affordable generic version of Copaxone 40 mg following regulatory approval." Momenta still has to get past some additional hurdles, but investors are hopeful that the path forward is clearer.

Ally posts friendly results

Ally Financial gained 7% in the wake of its release of fourth-quarter financials Tuesday morning. The online banking company saw an 8% rise in adjusted earnings per share on a 13% rise in pre-tax income from continuing operations, as net interest margins rose. Ally said that deposit growth hit new records, with a $12.5 billion rise in deposits compared to last year's figures. With an expanded portfolio of products that include direct-to-consumer mortgage, auto financing, and digital wealth management, Ally is optimistic about its future, and CEO Jeffrey Brown believes that "Ally's customer-centric value proposition continues to resonate in the marketplace, laying a solid foundation for future growth." Shareholders appear to agree, based on their reaction in the market today.

Thermo Fisher looks healthy

Finally, Thermo Fisher Scientific climbed 6%. The life-sciences specialist reported its fourth-quarter financial results early Tuesday, which included full-year sales gains of 8% and double-digit percentage growth in adjusted earnings per share. The company has been extremely active in making acquisitions over the past year, including the purchase of Affymetrix, but CEO Marc Casper believes that further opportunities are still possible for Thermo Fisher going forward. With geographical expansion, a greater breadth of offerings, and plenty of capital to deploy, Thermo Fisher is confident that it can make 2017 an even stronger year for the company than 2016 was.