I see that Steven den Beste linked to me as a general source of med-chem info, which was good of him. He was discussing resistance in treatment of tuberculosis (on the way to a broader point about current events), so I thought I'd say a few words about antiinfective drugs.
As I've mentioned in the past, it's not an easy area. At least, not any more. This was one of the first frontiers for medicinal chemistry (think Salversan for syphilis, sulfa drugs, penecillin and so on.) But it's clear that no one realized the long-term consequences of the free use of those early drugs. And even if they had, I doubt if much would have changed. There wasn't much incentive for restraint, not when people who were marked for death suddenly getting up and walking around.
It's easy to forget how serious infectious disease was back then. People are horrified now when there's a death like, say, Jim Henson's: a rampaging septic reaction that kills within a few days. But go back a hundred years, and that sort of thing happened all the time. Earaches could kill you, things that we'd consider bad colds might end up killing you. A toothache could signal that the end of your life was a week or two away. No, once drugs came around that could fight this sort of thing, no one felt like holding back.
But now we've burned out a lot of the easy targets. There are, broadly, two classes of drug targets against bacteria and other infectious agents. The first are enzymes and pathways unique to the pathogen, and those are naturally the best. Penecillin and all the related drugs fall into this category. They mess up the synthesis of the bacterial cell wall, leaving the affected organisms naked to the world and thus easy prey for the immune response. Cells of higher organisms don't make such walls, so you can beat on that pathway all day long without much risk.
The second group are targets that are present in humans as well, but with enough variation in the protein that you can hope for a selective compound. This takes more work, most of the time, and sometimes you can't separate the activity enough to be useful. Many bacterial enzymes are distant cousins of their human equivalents, but many others are too close to work against.
And with either class of drug, you have resistance. That's what they didn't appreciate in the early decades - and if they did, they underestimated it. Bacteria have such short life cycles, and there are so many of them. They're an ideal laboratory for evolution, and when humans came in and put the selection pedal down, the changes started and haven't stopped.
One common mechanism is for the target protein to end up mutating. There's a good amount of genetic variation in the bacterial population, and some of the group you're trying to hit might have a form of the protein that doesn't bind your drug. Given enough bacteria or enough time, there are bound to be some. So you treat with the drug, everyone else dies, these naturally resistant organisms have the whole field to themselves, and they run wild.
Sometimes the bacteria whip out another protein to take care of your drug all by itself. That's what happened to penicillin. Some bacteria turned out to have an enzyme to defend against such compounds (which are, after all, found in nature as antibiotics.) The enzyme, beta-lactamase, cleaves the crucial four-membered ring at the heart of the whole drug class. Naturally enough, this enzyme is all over the place now. (Thus the drug Augmentin, which contains a penicillin derivative and another drug, clavulinic acid, which inactivates beta-lactamase. But as you could guess, organisms have appeared whose beta-lactamase isn't affected by it.)
Yet another resistance mechanism is an active-transport pump. These are membrane-spanning proteins that physically expel the drug molecule once it enters the bacterium, pumping it right back out before it can do its job. (Cancer cells do the same thing, by the way.) What makes all of these such a problem is the habit many bacteria have of swapping DNA segments like trading cards. It's hard to measure, but I'm sure that over the years we've selected for accelerated DNA transfer. Under stress, the active traders have an edge, since they have a better chance of swapping in some DNA to code for the necessary inactivating enzyme or pump.
It's a battle. And from all appearances, it's never going to end. We're fighting tenacious, adaptable organisms that pull out all the stops all the time. They don't sit around fretting about the younger generation and their DNA-swapping ways, or worry that they're losing their essential staphylococcusness by taking on all these new characteristics. There are no spirochetes grousing that an arginine at that position was good enough for their granddads, and it's good enough for them. No, they'll do whatever it takes. It's life or death for them. Just like it is for us.