The U.S. energy boom is producing a little-noticed side effect: American oil and gas companies are paying less in federal income taxes.

Energy companies are spending billions of dollars a year to drill in shale formations across the country, sending the nation's daily oil output up by almost 50% in just the past few years. Techniques like hydraulic fracturing and horizontal drilling, which make it possible to tap petroleum in these new fields, make each well cost millions of dollars.

All that spending has allowed drillers to take advantage of incentives in the tax code for drilling and capital expenditures, deferring billions of dollars in income tax.

Ultimately, companies will have to pay some or all of the taxes. But as long as they continue to invest heavily, the spending shelters their income and allows them to defer taxes for years, experts say. In the meantime, they can use the extra cash flow to drill more wells.

Over the past five years, 20 big publicly traded U.S. oil and gas producers paid a combined $15.6 billion in U.S. income tax, or 11.7% of their American earnings, and deferred $16.5 billion, according to the nonpartisan Taxpayers for Common Sense. Together, the 20 had an effective tax rate of 24% on their U.S. income, below the statutory 35% rate and well below the 46.2% those with overseas operations paid abroad, according to an analysis by the watchdog group, which advocates ending subsidies for industries from agriculture to defense.