The stock market surged on Thursday, with major benchmarks climbing 1% or more in the wake of good news on the political front. The House version of the tax bill got a positive vote from lawmakers, achieving congressional representatives' self-imposed deadline of getting a bill passed by Thanksgiving. Tax reform is far from a done deal, with the Senate working on its own version of the proposal and needing to hammer out compromises on a number of key elements. Despite the overall positive mood among investors, companies with bad news missed out on the rally and posted substantial losses. Viacom (NASDAQ:VIAB), Diplomat Pharmacy (NYSE:DPLO), and Bitauto Holdings (NYSE:BITA) were among the worst performers on the day. Below, we'll look more closely at these stocks to tell you why they did so poorly.

Viacom deals with sluggish performance

Shares of Viacom fell 4% after the media giant reported its fiscal fourth-quarter results on Thursday morning. The company said that revenue was up just 3% compared to the previous year's fiscal fourth quarter, although adjusted net income climbed 14%. Yet affiliate revenues were down slightly, especially in the domestic area, and a drop in cable television subscribers pointed to the continuing pressure from cord-cutting that Viacom faces. Even as the company's Paramount Pictures division looks to generate more hit content, Viacom will have to address core fundamental weakness in the cable and media businesses in order to deliver its full potential to shareholders.

Building with Viacom logo and current movie and television offerings on posters.

Image source: Viacom.

Diplomat makes a merger move

Diplomat Pharmacy stock plunged 23% in the wake of the company's decision to acquire pharmacy benefit manager LDI Integrated Pharmacy Services. The deal involves paying $515 million in cash and about $80 million in Diplomat stock to LDI Integrated's owners. The concern among Diplomat investors seems to be about the company's future direction, and CEO Phil Hagerman appears to be committed to seeing "Diplomat evolve from a specialty pharmacy provider to a broader healthcare company." Shareholders aren't thrilled about that strategic shift, and given the immense competition in the PBM space, it's easy to understand why Diplomat shares are getting hit in light of the move.

Bitauto subsidiary finishes its IPO

Finally, shares of Bitauto Holdings declined 9.5%. The Chinese internet content and marketing services provider for the automotive industry said that its Yixin Group auto retail transaction platform subsidiary had completed its initial public offering Thursday morning in Hong Kong. Yixin offered almost 879 million shares, or about 14% of its total issued shares, to investors, but Bitauto will still maintain majority control of the unit. Still, Bitauto shareholders were disappointed when a more-than-30% initial jump in Yixin's share price to more than 10 Hong Kong dollars per share eventually deteriorated to just a 5% rise over the IPO price by the end of the session. Investors will have to watch closely to see how Bitauto does when it announces earnings early next week.

Dan Caplinger has no position in any of the stocks mentioned. The Motley Fool recommends Diplomat Pharmacy. The Motley Fool has a disclosure policy.