ROBERT A. HEINLEIN'S The Number of the Beast (Fawcett, $14.95; paperback, $6.95) is a frustrating book. It's frustrating because it's a very bad book that could have been -- well, certainly not a great book but surely a good one and possibly a very good one.

It opens with a quartet of typically Heinleinian characters: a brilliant, crotchety, middle-aged scientist; his tough savvy, pragmatic, second wife; the statuesque, lusty daughter of the scientist's first marriage; and her brilliant but muscular husband.

While off for a double honeymoon at the underground country retreat of the elder scientist, the four discover that the earth is being invaded by a race of malevolent aliens aided and abetted by a secret network of human traitors and/or dupes. They escape an assassination attempt in the senior brilliant scientist's computerized dimension-hopping Ford, the Gay deceiver, . Discovering that Gay can pop into and out of the point along the six axes of space-time gives the adventurers access to a virtually limitless number of universes. And so, off they go. . . .

It's a promising premise, although possibly too great for much suspense. E.g., suppose the bad gives you a terrible thrashing and leaves you all but dead. You need merely pop back through space-time and await his arrival with a Reggie Jackson model Louisville Slugger in your fist, then cream the bajeezus out of him before he can lay a mitt on you.

Totally ignoring the logical glitch, Heinlein pops his foursome into an alternate universe where Victorian England and Tsarist Russia have established rival colonies on the planet Mars. Colonists travel between the worlds in wonderful dream-image spacecraft with huge flapping wings and survive on Mars in a chronic state of not-quite-war. Heinlein's travelers get involved in the conflict, avert a dreadful disaster, become drawn into the mini-court politics of the English colony. It's all lovely stuff, with the makings of a fine piece of pseudo-Victorian science fiction of the sort done occassionally by Christopher Priest, Brian Aldiss, or Michael Moorecock.

Unfortunately, Heinlein wanders away from this setting, getting his characters mixed up with various other worlds and problems. Some are very intriguing, especially a sort of alternate present-day USA in which laisez-faire is carried to a degree that would send Ronald Reagan screaming into the arms of Teddy Kennedy. But as far as novelistic structure is concerned, if one may fling about such elementary notions as challenge, response, and outcome, things turn totally to porridge.

Eventually even the author gives up. He brings a whole army of characters onstage for a sort of super World Science Fiction Convention. His own fictional creations rub elbows with those of other authors and the authors themselves. Heinlein forestalls harping critics ante hoc by inviting them to a special lounge furnished with typewriters and tape recorders but no ribbons or tapes, a dining room but no kitchen, and a bar but no booze.

A couple of characters bring up the original incident that started this farrago and dismiss it out of hand.

Aside from its overwhelming structural flaws, the book suffers from a gastropodous pace and from some of the most intolerable coyness on record. Here's an example from Chapter IV. The narrator is Deety, the sexy young bride.

"I pulled on briefs, started to tie on a halter -- stopped and looked in the mirror. I have a face-shaped face and a muscular body that I keep in condition. I would never reach semifinals in a beauty contest but my teats are shapely, exceptionally firm, stand out without sagging and look larger than they are because my waist is small for my height, shoulders and hips. I've known this since I was twelve, from mirror and from comments by others."

Six paragraphs later she's still ruminating about her teats. It takes this simpering imbecile four more paragraphs before she finally decides to wear the halter.

Now why, why for God's sake, didn't Heinlein's editor just draw a big blue diagonal through those paragraphs and knock the whole internalization out of the book? Easily 200 of the novel's 512 pages could similarly have been eliminated, leaving a reasonably tight manuscript. The structure might then have been repaired.

I think the reason is that Heinlein, along with about a half-dozen other writers in this field, has reached such a level of commercial success that he can sell anything he writes. Editors and publishers don't dare demand solid structure, tight copy, or polished prose of this crew for fear that they will simply pull their manuscripts and sell 'em elsewhere.

In the short run this places Heinlein and others similarly situated in an advantageous position. But ultimately it makes for inferior books, thus working to the detriment of the reader's pleasure and the writer's reputation. Such an unbridled talent may occasionally produce a Citizen Kane; more often the result is -- well, name your most unfavorite of Jerry Lewis's self-indulgent messes.

Songmaster, Orson Scott Card (Dial Press $10.95) is the story of one Ansset, a "Songbird" in a galactic empire of the fairly remote future. Like many such empires, the one created by Card is a strange mixture of the super-advanced (namely, interstellar travel) and the regressive (emperors, courts, armies, peasants, castles).

It's a too-familiar picture, but Card adds a most striking feature, the Songhouse of Tew. Here singing is raised to the level of a philosophy, virtually of a religion. And the finest of the singers, the Songbirds, are sent to the most deserving throughout the galaxy. The Songbirds are apparently all sopranos, sent out in childhood, their sexual maturation delayed a few years by drugs. Even so, by their mid or late teens, Songbirds return to the Songhouse to serve the rest of their lives as teachers, administrators or the like.

Ansset is the galactic emperor's own Songbird, and provides a unique point of view for a novel of personal growth and exploration melded into a tale of interplanetary politics and court intrigue. Card strives for emotional intensity and often achieves it. On occasion he deals from a stacked deck, as when he withholds information regarding a side effect of the Songbird's drug -- from Ansset and the reader alike -- for the sake of a melodramatic moment. But most often he plays fairly and he plays well.

If the book has a major -- or even semi-major -- flaw, it is a certain sense of coldness and austerity. Card is too controlled a writer for this to be inadvertent; perhaps the calculated starkness of the background is intended to make the story's physical drama and emotional intensity stand out. If so, Card sells himself short -- he would have succeeded anyway. Songmaster is a first-class job far superior to Card's previous novel, A Planet Called Treason, which was miles better than the still earlier Hot sleep.

While Orson Scott Card's first three novels show steady improvement, John Varley's -- alas! -- show the opposite. Varley's first, The Ophiuchi Hotline (1977), was vastly ambitious and substantially successful. Varley's short fiction had already generated huge excitement among science fiction readers, and the novel was joyously received.

His second, Titan (1979), was both more successful and less rewarding. It dealt with the discovery and exploration of a giant alien-built spaceship/artifact/worldlet. It was essentially a travelogue. Varley wrote it very well, but it had already been written by Larry Niven (Ringworld) and Arthur C. Clarke (Rendezvous with Rama). It's pure travelogue while Varley enriched the brew with some interesting characters. But still, he was essentially reexamining familiar ground.

His third Novel, Wizard (Berkley-Putnam. $12.95), is still another rewrite of a book that is now growing awfully tired. Again Varley adds a couple of new and interesting characters -- a man suffering from a peculiar intermittent psychic condition on earth and a woman raised in an all-Lesbian space colony. But it's the same worldlet, Gaea, and the same plot, namely a lengthy trek ending in a confrontation with the being who in one sense rules and in another sense is the world.

A third volume of the stuff is promised by Varley's publisher, and I shudder at the prospect. Is this truly dazzling young talent played out already? Or can he put these derivative trivialities behind him and regain the form that he showed in The Ophiuchi Hotline? Read Varley's novel-after-next and find out.