McCain was apparently referring to the 2005 energy bill, which he did vote against and Obama did vote for. It was in fact loaded with tax breaks and incentives for oil and gas companies, which is why Sen. McCain opposed it. The bill passed.
That said, the oil companies later said that they didn't end up benefiting from the tax cuts that were built into the energy bill for them. And the Congressional Research Service found that in the end, the oil companies ended up paying more taxes.
The bill also contained tax breaks for ethanol — which is a fuel that Sen. Obama favored on behalf of the corn growers in Illinois. And it contained other money for alternative energy sources. However, the ethanol subsidy ended up encouraging farmers to grow corn for fuel instead of for food. And that played some role in the huge run-up in food prices — exactly how much is debatable.
It also continued subsidies for nuclear power, wind and other alternatives, but did not effectively address global warming with measures such as a fuel-efficiency standard.