Alan Bray was brought up in a working class area where his father worked in the engineering industry. His mother died when he was 12 years old. At the age of 13 he met Graham Wilson at the Central High School in Leeds and they became life-long friends. Alan Bray went to Bangor University where he took a joint degree in history and English. At this time he also took up Anglo-Catholicism enthusiastically, and after graduating he started training for the priesthood in an Anglican seminary but dropped out after a year.
In 1970 he began a career in the Inland Revenue and earned a reputation for intelligent management and skillful handling of cases. He worked in Derek (later Lord) Rayner's team when the civil service was being reformed. He was able reach a satisfactory settlement in the Lloyd's fiasco, much to the surprise of many.
In the same year Alan Bray joined the Gay Liberation Front. He also helped to found the Gay Christian Movement. He was involved with the Gay News Defence Committee set up in 1977 to fight the libel prosecution of Gay News by Mary Whitehouse. He joined the Gay Activists Alliance and in 1979 he helped to organise their zap of The Guardian offices after the newspaper published an offensive article about the Gay Pride march.
During the day he worked in his job as a civil servant but in the evenings he was writing Homosexuality in Renaissance England. This helped fashion the view in the developing subject of lesbian and gay history that the concept of homosexuality was a product of history. He was a founding member of the Gay History Group. His employers in the Inland Revenue gave him a sabbatical in 1984 and he was elected as a research fellow of Nuffield College, Oxford. During this time he wrote The Clandestine Reformer: a Study of the Rayner Scrutinies.
In 1985 he was received into the Roman Catholic church and became a prominant lay Catholic advising the Archbishop of Westminster on gay issues. From 1994 to 1997 he was a member of the editorial collective of History Workshop Journal, a journal for socialist and feminist historians. The journal published two important articles by Alan Bray. He took early retirement from the civil service in 1997 after a serious illness and being diagnosed with HIV. He became an Honorary Research Fellow of Birkbeck College, University of London.
He lived for forty years with his lover Graham Wilson, in Notting Hill in London. He died of heart failure aged 53.