ONE of India's leading AIDS doctors, Alka Deshpande, did not choose her specialisation. Working as a hospital doctor in Bombay (now called Mumbai) in the late 1980s when AIDS was discovered in the city, she merely decided that she was prepared to touch the infected. Her colleagues would not do so—and perhaps still will not. According to a recent UN study, over half of Indian health-care workers thought AIDS was transmitted by touch.

In a mostly-Hindu society, which for thousands of years considered one-fifth of its members “untouchable”, discrimination and ignorance of this kind have a particularly unpleasant significance. Indeed, the ways in which AIDS and India's traditions interact are a striking feature of these essays about the disease in India, commissioned by the Gates Foundation. On a tour through the south-eastern state of Andhra Pradesh, which has a fifth of India's estimated 2.5m HIV cases, Kiran Desai meets women of several hereditary prostitute castes, including relatively affluent beauties who are apparently not unhappy with their lot, as well as wretched sex slaves, pimped by their neighbours. AIDS haunts them all.

In Karnataka, a hilly southern state, William Dalrymple—the only non-Indian contributor to the collection—meets the inheritors of the now illegal tradition of temple prostitution. In ancient times, its practitioners included the daughters of royalty, dedicated in childhood to service the devotees of the goddess Yellamma. The modern lot almost all belong to a single caste of illiterate dalits. They are distinguishable from run-of-the-mill village prostitutes only by their early entry into the career and therefore a higher probability that they will contract HIV. Nearly 40% of Karnataka's devadasis—literally, slaves of god—are believed to be infected with the virus.

India's regulations against sodomy and soliciting are another ugly local feature. By criminalising gay sex and prostitution, these laws have blocked many sincere efforts to quell the virus. Among Bangalore's gay men, as described by Mukul Kesevan, one in five has HIV. They come in three categories: kothis, who specialise in being penetrated; panthis, who penetrate; and “double-deckers”, who do both. The kothis, alas, seem a particularly woeful bunch. Many are rent-boys, perpetually terrorised and periodically raped by the police. Some are hijras, members of India's semi-ostracised “third sex”. By contrast, panthis, the transmitters of the AIDS virus, often lead regular family lives.

Almost all these essays are about sex and poor people. There are two exceptions. One is an interesting story by Siddharth Dhanvant Shanghvi about the death of a gay film-maker in Mumbai from AIDS. The other, by Vikram Seth, is about his own awakening to the virus in California in the 1980s. Accompanying it is a poem that he wrote at the time, a dying man's meditation on death, which ends: “Love me when I am dead/And do not let me die.” It is a moving plea.

More typically, these well-to-do writers seem to struggle for empathy with their wretched subjects. Sunil Gangopadhyay, a Bengali poet, succeeds better than most, with an engaging memoir of wanderings in Sonagachhi, the main red-light district of Kolkata (previously Calcutta). Ms Desai's essay is also finely observed: for example, a passage on the miseries of open-air prostitution, along a lonely coast-road, where a woman's price falls during the monsoon. Yet an awkward effort to write her father's terminal cancer into this narrative of suffering suggests her feelings of alienation from it. Sensibly, perhaps, Sir Salman Rushdie keeps his rather short dispatch from among the hijras of Mumbai more impersonal. Yet his contribution, which includes a description of a stiff, ex-army father's begrudging, but complete, acceptance of his hijra son, is one of the best.