AND THE BAND PLAYED ON Politics, People And the AIDS Epidemic By Randy Shilts St. Martin's. 630 pp. $24.95

FEW EPIDEMICS in modern times have been handled as badly as the current epidemic of acquired immune deficiency syndrome (AIDS), for which there is no apparent solution or end. As a socio-medical botch to parallel the recent history of AIDS, the swine flu scare of 1976 comes to mind but with an important difference: In 1976, there was a vaccine but no disease; a decade later, a disease but no vaccine. To swipe a line from Kurt Vonnegut: And so it goes.

A recent tally (informally known as "the body count") by the Centers for Disease Control in Atlanta shows a cumulative total of 40,845 diagnosed cases of AIDS in the United States since 1979 and 23,559 deaths. There are two ways of looking at what these figures imply: Except for the Spanish flu pandemic at the end of World War I, there has never been a more sweeping new scourge of the public health; on the other hand, more Americans die of breast cancer every year than have died of AIDS to date and nobody gets very excited about that.

Randy Shilts, a reporter for the San Francisco Chronicle, has written a monumental history of the AIDS pandemic that in the short span of a decade has reached into every corner of the globe and by now has spilled over from certain risk groups into the mainstream. Among the 40,000-odd cases mentioned above, 2,774 were women and 563 children, most of them babies.

Shilts goes back to 1976 to find the clinical beginnings of AIDS, first identified in a fatal case contracted by a Danish physician at a remote hospital in the central African country of Zaire. It is ironic that this disease, later so closely identified with male-to-male sexual activity and intravenous drug abuse, was to strike first a woman, and one who did not abuse drugs.

By focusing on the New York gay scene in 1976, Shilts makes a subtle point early in the book, which is amply borne out later: The rise and spread of AIDS occurred as quickly as it did because of the (to most people) incredible sexual enterprise and mobility of the group at highest risk: young, homosexual men.

To develop his theme, Shilts uses an actual individual named Gaetan Dugas, a French Canadian airline steward who through his unlimited access to free travel may have done more to spread AIDS through the world than any other individual. Dugas died on March 30, 1984, in Quebec City, after having been identified as Subject Zero -- the focal individual -- in the first big epidemiologic study of the sexual transmission of AIDS.

Dugas is a character who would have had to be invented did he not already exist. ("This is a work of journalism. There has been no fictionalization," Shilts says in an author's note. The blond steward was, by all accounts, a gorgeous hunk who had only to drop into a gay bar or bathhouse to have all comers flocking to him. At first he was the conquering hero; then, after contracting AIDS-related Kaposi's sarcoma as early as 1980, he became a self-pitying victim, and finally, consumed with anger, he turned into an avenging angel, deliberately infecting everyone he could find with the disease that was killing him.

The self-centeredness of Dugas is pivotal to Shilts' account: Everybody is looking out for No. 1. There are few heroes in Shilts' book -- Surgeon General C. Everett Koop is one, belatedly. Villains abound -- bureaucrats, gay leaders, bathhouse operators and blood bankers who, like spokesmen for the tobacco industry, kept on denying causal connections between life style and disease long after any reasonable person could harbor doubts; politicians big and small who paid lip service to a fight against AIDS but never followed through with meaningful levels of effort.

Shilts points out, correctly, that when Legionnaire's disease struck a gaggle of middle-aged American veterans and toxic shock syndrome hit young American womanhood -- to say nothing of the Tylenol scares of the early 1980s, the response of the U.S. public health establishment was like an avalanche. The same might be said of the response in 1976 to the non-challenge of swine flu. But when many times more gay men and drug abusers were stricken with the virus of AIDS, nobody paid much attention. Not until Rock Hudson sickened and died in 1985, giving AIDS the celebrity it had previously lacked, did the scourge finally achieve something like disease-of-the-month status.

The Band Played On develops this theme deftly, making the book not only required reading for those interested in politics, medicine, science, civil rights and liberation movements of various kinds, but also for those just looking for a good read.

The best that can be said of some figures in the AIDS crisis, on the basis of Shilts' reportage, is that they were ignorant. The infighting among influential figures in the federal health bureaucracy, as described by Shilts, cost money, lives and time, which of course are (respectively) precious, priceless and irretrievable.

There is no effective drug today and not even a rational outlook for a vaccine at any time in the years ahead. The 17,286 surviving diagnosed patients with AIDS, according to the body count mentioned above, will be dead within two to five years and, like dragon's teeth, others will spring up many times over to replace them on the diagnosed-but-living list.

No one knows where or how the AIDS epidemic will end, and Shilts does not try to predict. One thing this book is not -- and part of its strength stems from this fact -- is alarmist. Angry, yes; alarmist, no. Shilts has a horrifying story to tell, and except for a few lapses toward the end into polemics, he tells it straightforwardedly and, if anything, with understatement.

Off the subject of AIDS, on which he seems impeccably briefed, Shilts is a bit weak. He attributes to Louis Pasteur in 1874 the first vaccination, credit for which actually goes to Edward Jenner in 1796 (Pasteur's rabies shot dates from 1885.) He asserts incorrectly that only 11 vaccines have been perfected since 1874, whereas there are actually dozens of vaccines currently approved in the U.S. for 23 separate human diseases. Shilts mistakenly says the National Institute of Allergy and Infectious Disease is the second-biggest component of the National Institutes of Health; actually, the Heart, Lung and Blood Institute is.

But these are minuscule flaws in a major book about a topic that wasn't very important to most people as long as it was confined to Castro Street and Skid Row.

William Hines is a free-lance science writer in Washington.