If you like numbers and the intrigue buried in the U.S. tax code, you’ll enjoy—and be infuriated by—recent reporting in The Nation about little-known loopholes that let our largest corporations dodge taxes.

Particularly juicy for those who enjoy excursions into the penetralia of the code are the tax-ducking tactics of aircraft manufacturer Boeing and tech Titans Apple and Facebook, as examined by reporters Sarah Anderson and Scott Klinger.

Boeing, on whose planes you’ve no doubt traveled if you’ve ever flown anywhere at all, charges us twice for its research and development, it appears. The company takes advantage of a tax break for research and experimentation passed in 1981 as a temporary shot in the arm for the economy. Were Fortune 500 types going to let go of a lollipop like that? Fat chance; the law that created the break has been renewed 13 times.

Meanwhile Boeing has snared $54 billion worth of defense contracts over the last nine years, which entitles it to charge the government for all expenses connected with filling its orders, including R&D (in eight of those nine years, by the way, Boeing has paid no corporate tax). So for much of Boeing’s R&D (worth $137 million last year), taxpayers are paying twice—not a happy thought as one settles in for the next voyage on a 767.

Then we have tech and communications icons Apple and Facebook, who have benefited (in Apple’s case) or stand to benefit (as Facebook may when it goes public) from a loophole allowing companies to show their shareholders one set of books and the Internal Revenue Service another.

The loophole, which has Sen. Carl Levin (D-Mich.) frothing, allows companies to show shareholders the value of stock options at the time they’re taken out, which is relatively low, and the IRS the value of the options when they’re cashed out, which is often much higher. As Levin said in a Senate speech late in February, “Under current law, Facebook can… tell investors, the public, and regulators that the stock options [Mark Zuckerberg] received cost the company a mere 6 cents a share—that’s the expense shown on the company’s books. But the company can also… later file a tax return claiming that those same options cost the company something close to what the shares actually sell for later on—perhaps $40 a share. And the company can take a tax deduction for that far larger amount.” (Another problem with this practice, Levin explained, is that even as the high value of stock options gets the company a huge tax break, the lower value shown the shareholders may make the business seem more profitable than it really is.)

This loophole has saved Apple $1.5 billion in taxes over three years, and could get Facebook a $3 billion tax break after it goes public, including a $500 million refund of taxes already paid. Levin and John McCain in the Senate, together with Pete Stark (D-Calif.) in the House, have proposed legislation that would end this system.