Patents are supposed to be issued for new and novel things, not things that anybody could have come up with. A patent can be invalidated for "obviousness" if the thing that is to be patented is based on prior art and that thing would have been obvious to a person of ordinary skill in that field.
In the field of pharmaceuticals, a drug can be considered obvious if it's the made by adding something to an extant chemical -- something that anyone could have done and the result of which anyone would have expected. But what about after it's patented? That doesn't work, affirmed the Federal Circuit, in a divided opinion over a rehearing en banc in Bristol-Myers Squibb v. Teva Pharmaceuticals.