Leaders in Congress have reached a major compromise that would avert a government shutdown -- and it brings lots of goodies to Corporate America.
The $1.1 trillion spending deal still needs to be approved by lawmakers and avoid a White House veto, but there is optimism it will eventually get passed.
If that happens, here are some of the biggest winners:
Big Oil
The hurting oil industry will mostly cheer passage of the so-called omnibus bill because it includes a provision that would lift the 40-year ban on exporting crude oil. Lifting the ban is a recognition of surging U.S. oil production, which lowers the need to stock pile it and keep it from being sold overseas.
It will allow oil producers to ramp up output once prices rebound, creating more jobs and greater revenue. That's why Big Oil companies like ConocoPhillips (COP), Hess (HES) and Chesapeake Energy (CHK) have urged Congress to kill the ban.
Refiners dodge a bullet
Refiners opposed lifting the export ban because they had mostly exclusive access to U.S. crude oil. They were able to buy it at cheaper domestic prices and then sell it at higher global prices.
That gap created fat profits, which will likely disappear once producers can ship the oil overseas.
However, refiners get tax credits in the bill, according to Chris Krueger, a senior policy analyst at Guggenheim Securities. That's great news for refiners like PBF Energy (PBF) and Marathon Petroleum (MPC), each of which saw their stock prices tick higher on Wednesday as details of the deal trickled out.
Solar, wind
The solar industry may be the biggest winner, at least based on market reaction. Shares of Elon Musk's SolarCity (SCTY) skyrocketed 26% on Wednesday, while rivals SunPower (SPWR) and Sunedison (SUNE) enjoyed double-digit gains.
Wall Street cheered as the spending deal includes a five-year extension of a critical solar tax credit, which is known as the Solar Investment Tax Credit, or ITC.
"This is a huge extension that is far larger than we anticipated," said Krueger. The credit kicks in when construction of solar projects begin and not just when energy is produced.
The wind industry also won a five-year extension of tax credits. The news lifted shares of wind stocks like NextEra Energy (NEE), Broadwind (BWEN) and Ormat Technologies (ORA).
Medical device makers
Under the budget deal, the 2.3% tax on medical device sales will be delayed for two years, which is great news for those who make them.
The tax was part of Obamacare and had been aimed at raising $29 billion over 10 years.
However, the tax was strongly opposed by Medtronic (MDT), one of the leading makers of medical devices. Shares of Medtronic rose slightly on Wednesday.