NEW YORK (Fortune) -- This is the fifth installment in a series of health-care columns by Fortune's Shawn Tully.

The Obama Administration is touting its pact with the pharmaceutical industry as "an historic agreement to lower drug costs." Both sides claim the deal will save consumers -- and especially -- the federal government, a total of $80 billion over the next decade.

A close look at the details of the agreement, however, shows that the new rules could have precisely the opposite effect by substantially raising spending on pharmaceuticals. Seniors will wind up paying less in the short term, but taxpayers are going to get soaked down the road.

Why? Because the deal would weaken incentives for seniors to purchase cheap, generic drugs, incentives that are strong today. It's brilliantly designed by the manufacturers so that the elderly pay no more from their own pockets to consume costly, brand-name medications, with the government covering most of the extra bill.

Covering the 'donut hole'

The advertised "savings" come from the industry's pledge to cover part of what's known as the "donut hole" in Medicare drug coverage. Today, the program pays 75% of seniors' prescription drug bills up to $2,700 (after a $295 deductible). Then, they must spend as much as $3,500 of their own cash for 100% of their purchases until total spending reaches around $6,200.

That coverage gap between $2,700 and $6,200 is the famous donut hole, and the $6,200 is the "catastrophic care" threshold. After that, it's essentially a free zone where the government pays 95% of a senior's drug costs.

The donut hole actually has its virtues: By forcing millions of seniors to pay a large portion of their medication costs, it encourages them to buy much cheaper generic drugs. The new agreement between Obama and the drugmakers, however, would make generics far less attractive by effectively "shrinking" the donut hole.

Here's how it works: The industry is promising to provide a 50% discount for all brand-name drugs that seniors purchase in the "donut" zone between $2,700 and $6,200 -- a discount that does not apply to generics. The consumer pays half, but the amount that's billed is still full price as it applies to the donut hole.

How shrinking the hole raises costs

That still sounds like a great solution, but the perils appear when you do the math. The plan changes the game by enabling seniors to buy branded drugs for no more than they now pay out-of-pocket for generics. Worse, it will push far more seniors into the "free zone", where they can consume virtually any drugs they want, no matter what the price, at a tiny extra cost.

Let's take an example. Under the current plan, Harry, age 70, uses one brand-name medication that doesn't have a generic equivalent, for $250 a month, and three generic medications at $40 each, for a total of $370. Remember, the limit of the donut hole is determined not by what Harry spends, but the total bill for the drugs.

Harry's drug purchases come to just over $4,400 a year. With 75% of the first $2,700 covered, minus the $295 deductible, $2,640 comes out of his pocket, most of it from covering the full price once he reaches the donut. He doesn't come anywhere near the $6,200 that would lift him into the catastrophic category. Any more money he spends on drugs would come out of his own pocket, since he's smack in the middle of the coverage gap.

But now, let's zoom forward to the new deal that shrinks that coverage gap. With the 50% discount, Harry can now pay for $6,200 worth of drugs for the same $2,640 out-of-pocket, instead of $4,350 under the old rules.

Now that he's over the threshold, he decides to buy three brand-name drugs at $250 a month, each in place of the generics, at six times the cost. The enormous extra expense adds a piddling amount to the $2,640 he was paying out of pocket, since it's 95% covered by the government.

The result is that Harry now buys $12,000 in drugs versus $4,400 before. Indeed, the drug companies are paying part of the difference, but the government is paying far more �� hence the brilliance of the plan for Big Pharma. Harry can also get all the antibiotics and temporary therapies he wants for 5 cents on the dollar, now that he's in the free zone.

One caveat: "It won't be easy to switch from generics to branded drugs because of rules at the insurance companies, and state laws that favor generics," says Dr. Max Ferm, a distinguished consultant to the drug industry.

But the incentives will shift enormously, not where the White House promised but where the drug industry aimed them: Toward billions upon billions in new spending.

Read Shawn Tully's other installments in this series:

4 hidden costs of health care

Obamacare could cost you $4,000 a year

Designing the ideal health care system

Don't like Obamacare? Here's an alternative