As a child, Mr. Cox devoured books by Chaucer and Dickens and immersed himself in local theater. He came out early in high school, said his mother, who described it as being not such a big deal. “I said to a friend: ‘Would I prefer a child with a wife and two children and white picket fence? Sure. But I didn’t have that choice,’ ” she said. “And I don’t think he had problems in high school.”

In 1986, Mr. Cox left the South for Bennington College in Vermont, where he studied theater and introduced his friends to Bette Davis movies, which he could recount line for line. Then, after spending much of his junior year in New York and becoming involved with Act Up, the famously combative AIDS organization founded by the playwright Larry Kramer, Mr. Cox dropped out of Bennington and moved to Manhattan.

In short order, he found out he was H.I.V. positive. Bodies were piling up all around him.

“He had a tough and scary road ahead of him,” said John Voelcker, a friend from the old days who was with Mr. Cox the day he was tested. “AIDS was not then a chronic, manageable disease. It was something that killed.”

But after wiping away his tears, Mr. Cox threw himself back into his work at Act Up, where he served on the treatment and data committee. And in 1995, when protease inhibitors were in the testing phase, Mr. Cox (who had never taken any real interest in science before becoming involved in AIDS issues) played an integral role in helping to speed along and design the trial process for the drug Norvir.

“He was brilliant,” Mr. Kramer said. “He figured out single-handedly how to test these drugs more effectively than any scientist and statistician could.”

It helped save the lives of thousands of people, including himself.

Yet as the medications began to work, the movement itself — the organizing principle in Mr. Cox’s life — splintered, then broke down. An ever-escalating real estate market made it far more difficult for creative types, including those who toiled away on AIDS issues, to survive in New York City. The clubs and bars where Mr. Cox and his Act Up compatriots spent their nights — Woody’s, Boy Bar, Mars — closed their doors, and the Internet became a prevalent way for gay men to socialize and hook up.