Every afternoon at about four, a slight woman named Runi slips out of the cramped, airless room that she shares with her husband and their sixteen children. She skirts the drainage ditch in front of the building, then walks toward the pile of hardened dung cakes that people in this slum on the edge of the northeastern Indian city of Patna use for fuel. Dressed in a bright-yellow sari shot with gold threads, Runi is followed by several of her children. Although she can’t remember their ages, or her own, Runi must be about forty, because she dates her life from its first crucial memory: the smallpox epidemic that devastated Patna and much of surrounding Bihar province in 1974.

Runi survived that plague, and several others, but, about a year ago, after developing a persistent cough, she visited one of the private medical clinics that line the streets of Patna. There someone who called himself a doctor stuck a needle in her arm, drew a few drops of blood, examined them, and told her that she had tuberculosis. It is not an uncommon diagnosis. Tuberculosis has always been the signature disease of urban poverty, passed easily in poorly ventilated spaces. India has nearly two million new cases each year, and every day a thousand people die of the disease, the highest number in the world. Tuberculosis is also the leading cause of death among people between fifteen and forty-five—the most productive age group in any country and the key to India’s prospects for continued economic growth.

For most patients, the choices are bleak. Public hospitals are so overcrowded that people are forced to rely on inaccurate tests dispensed at private labs and clinics. They are unregulated enterprises, and peddle blood tests that are responsible for tens of thousands of misdiagnoses every year. “This is deadly,” L. S. Chauhan, the director of the National TB Control Program, told me when we met in New Delhi. “But there are thousands of labs. Shut one down and the next day ten more appear.”

Runi’s test was indeed worthless. It determined the presence of antibodies, which show that a body’s immune system has begun to respond to an infection. But most TB infections are latent: no more than ten per cent will ever cause illness. This means that ninety per cent of people with antibodies for TB in their blood don’t have the disease. Runi’s cough was clearly caused by something else.

Vaccines and antibiotics have long been seen as touchstones of medical progress. To stop tuberculosis, however, particularly in the developing world, an accurate diagnostic exam is needed even more. In India, China, and Africa, at least two billion people have latent infections. Yet every day thousands are told, mistakenly, that they are sick and need treatment. That’s what happened to Runi. Soon after she received her diagnosis, Runi began a regimen of powerful (and toxic) drugs provided by the public-health service, and she stuck to the program for the required six months. Not long after finishing, however, she started to feel worse than she ever had before. “This is the tragedy of our TB-control program,’’ Shamim Mannan said as we watched Runi’s children play. Mannan, who is from Assam, a few hundred miles from Patna, serves as the Indian government’s chief TB consultant in the region.

“Officially, she is cured,’’ he said. “But how would we know? She took a test that showed she had the antibody for TB in her blood. So do I. So do five hundred million Indians.” As Runi stooped to gather fuel for the stove, she began to cough, lightly at first and then with alarming force. Every cough sounded as if somebody had shattered a pane of glass.

“Now she really is sick,’’ he continued, explaining that Runi’s TB was no longer dormant, and that taking drugs when they are not necessary often makes them ineffective when they are. “This is what happens when tests mislead us. She will need the drugs again. If they don’t work properly, she will be in real trouble. She has almost certainly infected some of her children. That makes everything harder, more expensive, more painful.’’

Tuberculosis strikes vulnerable people with special ferocity. Victims are seized by severe night sweats, wasted by fatigue, and punished by the blood-tinged cough that is the disease’s defining symbol. In most cases, tuberculosis affects the lungs, but it can invade almost any organ of the body. When an infectious person coughs, sneezes, spits, or even shouts, he sends minute particles of sputum, or phlegm, into the air—exposing anyone nearby. For many years, the disease, which is caused by Mycobacterium tuberculosis, was referred to as “consumption,” because without effective treatment patients often wasted away.

To fight the infection, the body’s immune system forms a scar around the TB bacteria which serves as a kind of moat. Afterward, the bacteria lie dormant and cannot spread or infect others. But immune systems fail, and when that happens TB can move from the lungs to the bloodstream and then to the kidneys, the brain, and other organs. (That’s why in patients with H.I.V., which ravages the cells that the body uses to defend itself, tuberculosis becomes particularly deadly.) The only way to cure the disease is with a combination of antibiotics. The treatment lasts six months because the drugs work only when the TB bacteria—which grow slowly—are dividing.

For centuries, tuberculosis has been the source of misguided stereotypes, including the association of consumption with creativity and brilliance. “Doctors suspect that tuberculosis develops genius,’’ a 1940 article in Time pointed out, “because 1) apprehension of death inspires a burning awareness of life’s beauty, significance, transience, 2) the bacillus breeds restlessness and an intoxicated hypersensitiveness.” Keats, Chekhov, the Brontë sisters, and George Orwell—who was born not far from Patna, where his father managed the regional opium trade—all died of the disease.

Nonetheless, tuberculosis has always taken its most serious toll on the industrial-labor class—not on artists. The rise of industry throughout the world has been mirrored uncannily by a rise in deaths from tuberculosis. It was the leading cause of death in Europe and the United States from the eighteenth century into the twentieth. Then prosperity—rather than medicine—drove the rate of infection down. As a society becomes richer, the conditions that allow tuberculosis to flourish start to wane. Sanitation and housing improve and so does nutrition. By the nineteen-fifties, very few people in the West were dying of the disease.

In the developing world, though, tuberculosis has surged dangerously, and this year, according to the World Health Organization, there will be ten million new cases, the largest number in history. As people join the great migrations from villages to crowded cities, slum life and tuberculosis await them. With India’s urban population expected to double in the next thirty years, to seven hundred million, its cities will remain fertile ground for an infectious epidemic. Yet—no doubt owing to the fact that rich people in the West rarely get the disease—tuberculosis receives fewer resources, fewer research dollars, and less attention from the global health community than either AIDS or malaria—the two other most deadly infectious diseases. TB activists don’t march on Washington or chain themselves to the gates of pharmaceutical firms to demand better treatment.

Tuberculosis can be cured, but taking several antibiotics nearly every day for six months is not easy, particularly in parts of the world without running water or refrigeration. In 1994, the W.H.O. instituted a program called DOTS, which stands for “directly observed treatment, short course.” DOTS requires health workers to provide medicine—and then to watch people swallow it every day until they complete their treatment. Compliance is essential, because stopping treatment in the middle permits the most resilient strains of the bacteria to thrive, greatly increasing the chance that they will become resistant to basic, inexpensive drugs.

Thirty-six million people have received care under the DOTS program, eight million of whom would have died without it. It has been a triumph by any measure. Even DOTS, though, has not been able to keep the disease from spreading. That is largely because there is no cheap, reliable test that can determine who is sick and who is not.

Blood tests, like the one Runi had, often do more harm than good. One recent study found that Indians undergo more than 1.5 million useless TB tests of this kind every year. Other approaches are almost as unreliable. Examining a person’s sputum—a diagnostic procedure that was developed more than a century ago—remains the most common way to detect the infection. It is a laborious process. Technicians smear the sputum on a slide and then place the specimen under a microscope. The instructions are comically complex. “Spread sputum on the slide using a broomstick,’’ a typical recipe, posted on the wall of a clinic in Patna, begins. “Allow the slide to air dry for fifteen to thirty minutes. Fix the slide by passing it over a flame from three to five times for three to four seconds each time.’’ If the slide isn’t held over the flame long enough, false stains will appear—suggesting that people are sick when they are not. Hold the slide too long, though, and the stain will disappear and show nothing at all. The results are accurate little more than half the time.

“You can treat a lot of people, and India has,’’ said Madhukar Pai, an epidemiologist at McGill University and the co-chairman of the international group that assesses new diagnostics for the Stop TB Partnership. “But if you have tests that cause misdiagnosis on a massive scale you are going to have a serious problem. And they do.”

Medicine rarely provides magic bullets, but, for the first time, a technology has been developed that might help countries like India escape the endless cycle of mistaken diagnoses and haphazard treatment. A company called Cepheid, based in Sunnyvale, California, now makes a device, called a GeneXpert, that allows doctors to diagnose TB in under two hours—without error or doubt. “The machine is so powerful that it could help end tuberculosis,’’ Mannan told me. “I don’t think that is an exaggeration.’’

An editorial three months ago in the New England Journal of Medicine also raised the possibility that, with proper use of this device, tuberculosis—a disease that has been around since the days of the Pharaohs—could be eliminated. The cost, however, would be far too high for the Indian Ministry of Health. “Private business would have to take the lead,’’ Mannan said. “In the past, countries waited until they got richer and tuberculosis mostly went away. India cannot do that. The epidemic is just too big. And we are too poor.”

The GeneXpert was developed in 2002, with initial support from the Department of Defense. After the events of September 11th and the mailing of anthrax spores later that year, biological threats became a national priority. The only sure way to recognize dangerous new organisms, whether made by man or by nature, is to analyze their unique DNA, and the GeneXpert has tested billions of pieces of mail for toxins. Its diagnostic capabilities seemed even more promising, however. In 2008, with funding from the Bill and Melinda Gates Foundation, the Foundation for Innovative New Diagnostics, and the National Institutes of Health, researchers at medical centers throughout the world began to assess the machine’s effectiveness in diagnosing tuberculosis.

Its success was striking. In a study published along with that editorial in the Journal, researchers reported that the GeneXpert identified more than ninety-eight per cent of active TB infections, including many that sputum smears had missed. Because the test looks for the TB bacterium itself, rather than for antibodies, latent infections don’t confuse the GeneXpert as they do blood tests. The machine costs nearly twenty-five thousand dollars and each test is about twenty dollars. Prices could plunge if similar machines were introduced and used widely.

“This is absolutely transformational technology,’’ Peter Small, the director of tuberculosis programs for the Gates Foundation, said. “It is a system that removes the guesswork from one of our most deadly diseases.’’ Unlike the sputum technique, the molecular approach is straightforward: a patient spits into a cup, and the sample is placed in a cartridge that looks much like the pods used in many espresso machines. A computer examines the sample’s DNA to see if it contains the genetic signature of TB. Results are available within hours.