WHEN Mikhail Bulgakov's great novel The Master and Margarita was first published in the mid- 1960s, a quarter century after it was written, readers all over the world were astounded. Here was a work of the highest imaginative power and originality which cast an instant spell over all who came in contact with it, written by a long dead author whose name had previously been known only to Soviet literature specialists.

"A masterpiece had seemingly come out of nowhere," states Ellendea Proffer in the preface of her superb new biography of Bulgakov. But although Bulgakov's name became well known and translations of his other works followed, the man himself remained obscure. Many readers may have had a vague impression of Bulgakov as another Soviet literary martyr who died around the time of Stalin's Great Terror with his eyesight gone and his works banned, but specific information on his personality and private life was scarce.

Now Proffer has filled in much of what was missing in our knowledge of Bulgakov's life, and it cannot have been often that so much new material on a major 20th-century writer has been made available in a single book. A Bulgakov specialist who is bilingual in Russian, Proffer has been gathering this information since soon after the appearance of The Master and Margarita, and much of it has been obtained from sources which are fast disappearing: interviews with Soviet citizens who were friends and acquaintances of the writer, including two of his three wives. Although Bulgakov is very popular in the Soviet Union now, and access to his work is far easier than it was in the recent past (the best edition of the previously-banned Master and Margarita was published in the Soviet Union in 1973, with a text superseding that used by either of the two translations currently available in English), such major works as the ferocious satirical novella Heart of a Dog and several plays are still forbidden there. This suspect status places many obstacles in the way of researchers visiting Russia to study Bulgakov, and in her preface Proffer acknowledges assistance given her by "people whom I cannot name."

THE MAN who emerges from all this research is fascinating and attractive, but still mysterious in many ways. Born into an intellectual Kiev family which accepted the Revolution without ever being really convinced by it, Bulgakov remained for life a conservative. "Like so many members of the intelligentsia he was a Russian rather than a Soviet," writes Proffer, "a distinction preserved even today among Russia's intellectuals. From the start, one of Bulgakov's concerns as a writer was to reinforce the idea of cultural continuity with the world of the past." Added to this was a very Russian but equally un-Soviet love of the irrational and grotesquely humorous which comes out strongly in almost all of his works. He was a lifelong practical joker, and seemed to enjoy making people uneasy by affecting bizarre behavior. Proffer tells of one occasion when he pretended to be a tax inspector at a house he was visiting, disconcerting the guests by picking up household antiques, examining them and making disparaging remarks. This love of eccentric but straight-faced humor will be familiar to readers of The Master and Margarita and Heart of a Dog.

Although Bulgakov was drawn to literature, particularly the theater, from childhood, he chose to study medicine as a career. Medicine was a more "responsible" career than literature. Still, Bulgakov's medical experience fed directly into his writing. The scientist's meticulous eye for detail is always in eidence, and throughout his work there are references to medical procedures and to pathology, particularly that of the venereal diseases in which he specialized. Moreover, Bulgakov's training as a scientist merged nicely with his taste for grotesquerie to form a penchant for the strange brand of science fiction which surfaces in many of his works.

He received his degree in 1916, just in time for military medical service during the Russian Civil War. After spending sufficient time at the front and at a Kiev hospital to experience the most harrowing aspects of modern warfare, with its poison gas and other technological atrocities, Bulgakov was sent to the remote village of Nikolskoe. Here he was plunged into a world of peasant superstition and ignorance which he found equally horrifying. It is his experiance here, which he shared with his first wife Tatyana Nikolaevna, that he transformed into the short story collection, Notes of a Young Doctor. It was also during this period that Bulgakov devped a temporary morphine addiction, as the result of injections of the drug he took to relieve pain caused by an anti-diphtherial treatment, and which served as the subject of one of the stories in the collection. Soon afterward he gave up medicine to give all of his time to writing.

The strongest feature of Proffer's book is her detailed chronicle of the composition of each of Bulgakov's works, of its fate at the hands of censors, theatrical directors and others who could affect its final realization, and of the effects of all this on Bulgakov's health and state of mind. All of Bulgakov's known work, from the feuilletons he wrote in great quantity to generate cash during the impoverished years of his first marriage, through The Master and Margarita, which he was still revising during his last days, is described and analyzed in great detail. Proffer is especially successful in showing how closely linked thematically Bulgakov's seemingly diverse works are. The Fatal Eggs, a strange novella in which gigantic reptiles produced by a scientific accident involving a ''red ray" devour the populace, and The Crimson Island, a wild spoof on censorship, treat the destructive results of uninformed decisions made and enforced by men who have power but lack humanity and discretion.

This particular concern of Bulgakov's found a formidable focal point in Joseph Stalin, and the theme of the artist's fate in the hands of a tyrant is primary to virtually all of his writings. Proffer's account of the strange relationship between the highly individualistic Bulgakov and the most tyannical of Soviet leaders fills some of the most interesting pages in the biography. For some reason, Stalin took an interest in Bulgakov, conferring an immunity upon him that permitted Bulgakov to pursue at least a minimal theatrical career, while other, less daring writers were receiving midnight visits from the secret police. Stalin had seen Days of the Turbins, which presents a sympathetic picture of the "White Guard," a faction loyal to the czar which had resisted the Bolsheviks and with which Bulgakov's family had sympathized, and Zoya's Apartment, a comedy of Bulgakov's which brazenly satirized certain aspects of Soviet life. As his regime became increasingly repressive, Stalin endorsed bans on many Bulgakov works, but never permitted harm to come to the writer himself. When Bulgakov wrote a letter to Stalin requesting permission to emigrate, Stalin replied with a personal phone call. The terrified Bulgakov said that he had changed his mind about leaving the country, but asked for an opportunity to work with the theater -- a request which was granted.

BULGAKOV's fear of Stalin was justifiably intense, and he was not above groveling. When a play was required to honor Stalin on his 60th birthday in 1939, Bulgakov responded with Batum, an account of the uprising young Stalin had led in that city in 1902. Conceived in the best hagiographic manner and shimmering with biblical overtones, the play as summarized by Proffer is a disgrace. Bulgakov seems to have undertaken it as a last ditch measure to gain the favor that would permit the ban to be lifted from his other works. But he must have had other thoughts in mind when he gave Stalin a speech which included the words, "Don't you understand the duty of every honest man to do battle with the vile phenomenon thanks to which a country of many millions is crushed, living under oppression, with no rights? What is the name of this phenomenon? Its name is autocracy." Stalin banned the play anyway, apparently feeling that it was embarassingly misrepresentative and laudatory.

Why did Stalin spare Bulgakov while exterminating lesser offenders? Proffer believes that his most murderous rages were directed at true believers whom he perceived as renegades. Those who had never accepted the Revolution, she hypothesizes, he perceived as omehow honorable, and less worthy of contempt. Bulgakov, unlike the poet Osip Mandelstam, had never attacked Stalin directly, and was therefore permitted to live.

Proffer is exhaustive in detailing Bulgakov's relations with many other literary and artistic figures of the period. Her treatment of his exasperating relations with the Moscow Art Theater and Stanislavsky, who misunderstood and mutilated his plays, comprises virtually a book in itself, and her account of Bulgakov's final illness, the same sclerosis of the kidneys which had killed his father, and of the support given him by his third wife, Elena Sergeevna, in finishing The Master and Margarita are moving and strongly evocative of the period.

But the heart of the book is its literary analysis, and it is difficult to imagine Proffer's scholarship being surpassed for a long time. A few puzzling oversights do present themselves. The Master and Margarita is the diabolical novel par excellence. In it, Satan and an entourage of demons in human and animal disguise visit Moscow, where they instigate a selective form of chaos which highlights various absurdities of Soviet life. The book simultaneously develops three plots which, when they merge at the end, reveal it to be a revision and completion of the biblical Book of Matthew. Why, in her discussion of The Master and Margarita, does Proffer neglect so many musical references which bear on diabolism? Bulgakov is not being arbitrary when he gives characters names like Berlioz and Stravinsky, both of whom produced works which bring the devil very much to life (The Damnation of Faust and A Soldier's Tale). Also, it would have been interesting if the biography had documented Bulgakov's reaction to the works of other writers, his friend Olesha's novel Envy, for example, as well as to those of the many innovative composers and artists at work during the artistically wild Soviet '20s.

Proffer's very exhaustiveness in discussing Bulgakov's works may make portions of the biography heavy going for nonspecialists. Although each work is summarized, the author relies on some familiarity on the part of the reader with even the more obscure of Bulgakov's works. The format of the book, however, with its biographical material presented chronologically and discussion of literary works interspersed in chapters of their own, permits selective reading. The chapters of discussion are self-contained and may be consulted individually.

Simultaneously with the biography, Ardis has issued a large-format photobiography of Bulgakov. This book, also the work of Ellendea Proffer, is at its most useful when kept within easy reach while reading the biography. Many of the photos have been smuggled out of the Soviet Union and appear for the first time with captions in both Russian and English. Those which show buildings or locales described in Bulgakov's works are captioned with excerpts from those works. Taken by itself, the effect of this photography is strong enough to evoke a feeling similar to nostalgia for the remote era it depicts. Read together with the biography, it provides what will certainly be the last word on Bulgakov for years to come.