By 2002, Daria Hazuda had bet her career and several years of her life on what she hoped would be a groundbreaking HIV drug, one that could help save lives and reap huge profits for her employer, Merck & Co. Inc.

When the phone rang in her lab in West Point, Montgomery County, the news was bad: In tests, Hazuda's drug had sickened dogs. The results threatened to kill a project her superiors already were questioning because competitors' ideas seemed more promising.

"It was really devastating to the whole team," Hazuda said. "We had worked so hard."

Dead ends, however, had always spurred her on.

"It's like being a detective, putting the pieces together to make a story and seeing how those seemingly unrelated pieces can come together in that big eureka moment," said Hazuda, a fan of John le Carre's spy novels.

Despite the negative results in the dog tests, she and a team of hundreds around the world still believed that moment would arrive. They restructured the compound to eliminate the toxicities seen in dogs and brought Isentress to the market in 2007.

Their bet paid off. In the third quarter of this year, Isentress was Merck's fastest-growing drug, bringing in $197 million, an 84 percent increase from a year earlier.

The long road to developing Isentress highlights the challenges pharmaceutical companies face as they seek new drugs to replace billions of dollars in revenue that will be lost to generic competition in the next few years.

"It's the nature of the times. The public expects the drugs to have a nice safety profile, and so the process to develop drugs has become much more complex in the last few years," said Pablo Tebas, a doctor who directs the adult AIDS Clinical Trials Unit of the University of Pennsylvania and has consulted for Merck.

More important, Isentress represented a new method of attack on human immunodeficiency virus, which can cause AIDS. The virus mutates constantly, developing resistance to drugs and necessitating new ones.

For many patients, Isentress reduces the amount of HIV in their bodies, with fewer side effects than other treatments.

Tom McCoy, a Center City resident who is HIV-positive, said adding Isentress to his drug cocktail had helped him achieve a key treatment goal: The virus is undetectable.

"The best way to fight this disease is to take medicines that hit it from different angles, and Isentress is a different angle," McCoy said.

James Vokoun of Holland, Bucks County, always had detectable HIV levels - until he started taking Isentress three years ago.

"In one month's time, I went to undetectable, which in and of itself is a miracle," said Vokoun, 50. "But what is beyond that is that I had no side effects, no diarrhea, no nausea, no headaches - nothing."

A drug with fewer side effects is a huge plus, especially for an HIV medicine. HIV treatments can raise cholesterol and trigger diabetes, requiring close monitoring of diet and exercise. Often, patients take anticholesterol agents, insulin, or other medicines to tackle side effects.

Vokoun, for example, takes 20 medicines every day, some for HIV and others for side effects. The more drugs patients must take, the less likely they are to take them as prescribed. And skipping doses gives HIV greater opportunity to develop resistance to treatment.

As a girl in Hillsborough, N.J., Hazuda dreamed of a career that would help people. Her father was an engineer. Her mother worked in the regulatory-compliance division of Janssen Pharmaceutica, now part of Johnson & Johnson.

Hazuda's parents urged her to be a lawyer or a doctor. She pursued a premed degree at Georgetown University, but a part-time job in a lab there led to a lifelong love affair with research.

Drug development seemed like a natural. She learned scientific language at her mother's knee, and she believed a home-run drug could touch thousands of lives. After getting a doctoral degree in biochemistry from the State University of New York at Stony Brook, Hazuda eventually joined Merck in 1989.

As she studied HIV, hepatitis C, and Alzheimer's, she realized that most research went nowhere.

"So many things fail when they get into the clinic," she said. "You have to be an optimist to be in this business."

Hazuda focused her work on integrase, an enzyme HIV uses to integrate itself into a human cell, but many scientists questioned whether that tack could work.

As the HIV virus duplicates, integrase cuts and pastes key coding into the host cell. Blocking it to prevent duplication would require a drug that could be there every time it happened.

"There were people who thought you could never be Johnny on the spot like that," said Steven Young, who heads Merck's department of medicinal chemistry in West Point and worked with Hazuda on Isentress.

That issue, and the threat that competitors would find better ideas, stirred debate at Merck. Hazuda and Young's superiors urged them to drop integrase as a target.

"We stuck our necks out," she said, and all but promised an integrase inhibitor.

They were true believers. They had seen strong evidence that integrase inhibitors worked against HIV in test tubes. Eventually, they figured out they didn't have to prevent the cut-and-paste step completely - they just had to stall it long enough to give the cell time to destroy the virus itself.

"I think of it kind of like tripping a runner in a race," Hazuda said.

Often, the work was tedious. Over several months in 1999, Hazuda and two assistants screened 250,000 compounds by hand because the robots that usually did the work were incompatible with her methods. Hazuda knew Merck colleagues in Rome were working on similar drugs against hepatitis C, and they collaborated to see whether any of those molecules would work against HIV. One did, and it eventually became Isentress.

In 2006, the U.S. Food and Drug Administration approved Isentress for HIV patients who already were getting treatment. This year, the FDA approved it for patients who have not received treatment, opening up new sales opportunities.

Despite the success of Isentress, HIV remains a life-threatening virus. Efforts to develop a cure or vaccine so far have failed, and patients criticize the high cost of the drugs, including Isentress.

Hazuda continues to cycle through frustration and elation as she works to improve Isentress - she would like to reduce the number of required doses from twice to once daily, for example - and to find new HIV treatments.

The work has reaped unexpected rewards. About a year ago, after she had given a speech in Zurich, Switzerland, a doctor pulled her aside to meet a patient whose HIV levels were undetectable for the first time. Doctor and patient were speaking French, but Hazuda got the message.

"The patient was just absolutely so thankful," she said, "that I thought he was going to jump out of the bed."