Humour and fantasy traditionally go well together, to the extent that those first three words form the title of a long-ago and celebrated F.Anstey omnibus. Humour and today's  fantasy genre... that's different, since the publishing category created by Tolkien's success seems distinctly short of indigenous humour with any real bite. The popular Unknown vein of fantasy (from the de Camp/Pratt "Harold Shea" stories, Heinlein's Magic, Inc and Anderson's Operation Chaos to such latecomers as Niven's "Not Long Before the End") achieved its deadpan effects by applying engineering logic to the irrational, assimilating fairyland into hard SF. Most other attempts at funny genre fantasy tend to run out of jokes which emerge naturally (all right, "organically") from the actual material. Instead they beat the reader unmercifully with the imported bladder of anachronism: I'll just mention Bored of the Rings, which despite a few shrewd pokes at Tolkien founders under its authors' conviction that American brand names are inherently hilarious. I will not mention Robert Asprin, thanks, nor Piers Anthony's dismal puns.
What I like about Terry Pratchett is that he's whole-heartedly funny and can spoof the genre from inside – from an affectionate and informed standpoint, just as he did with Nivenesque hard-SF tropes in his earlier novel Strata. The Equal Rites blurb insists that he "is to fantasy what Douglas Adams is to science fiction". Fair enough as regards wit and to some extent popularity: misleading if you take it to mean that Pratchett is merely using a few easily picked-up genre elements as a flashy vehicle for nihilistic humour. The best parodies are written by those who know and love the original.
Pratchett knows his stuff. The Colour of Magic, his first book in this vein, gets in some sly digs at (amongst others) Fritz Leiber, Anne McCaffrey, H.P.Lovecraft, Robert E.Howard, Jack Vance and Larry Niven, all within the framework of a plot so daft as to be indescribable. The setting is the flat Discworld, which as you might expect is supported on the backs of four elephants standing on the shell of the colossal turtle A'Tuin, who plods through the void to some unknowable destiny while the world's inhabitants dangle low-tech space probes over the edge in hope of solving the ultimate riddle of A'Tuin's sex. Magic on Discworld is a dodgy business, with thaumatoactivity all too liable to leak through spell books' reinforced covers and contaminate the landscape (one tries hard not to remember the author's real-life occupation as PR man at a certain nuclear power station). The dottiness continues in a second novel, The Light Fantastic, which devotes more space to Pratchett's most popular character, the eternally grim, humourless and skeletal straight-man Death. Equal Rites is the third Discworld book, and spies inform me that at least two more are in preparation.
This current offering has less overt parody and more of a conventional plot, inspired by observation of fantasy's recurring magical sexism. Even Ursula Le Guin subscribes to it in her Earthsea trilogy. Wizards get to ransack the ultimate secrets of heaven and hell, while witches give you warts. Enter, therefore, the wizard Drum Billet, knowing the hour of his death and fated to pass on his staff and power to the new-born wizard who by Discworld numerology must be the eighth son of an eighth son: and of course it emerges too late that the baby is a girl, now landed with the destiny of following a profession which has about as many equal opportunities for women as the College of Cardinals.
Young Eskarina, or Esk, is taken in hand by the powerfully idiosyncratic and smelly Granny Weatherwax for partial education in witchery – most of which is merely smoke and mirrors ("headology", in Granny's phrase), although there's an interesting notion in "Borrowing", whereby witches can briefly sit as navigators in birds' or other creatures' minds. This first shows Pratchett in more serious mood with a Le Guinish little fable when Esk overdoes Borrowing and nearly loses her identity: later, in a characteristically manic development, the technique is extended to the "mind" of a vast university building, and "For the first time in [Esk's] life she knew what it was like to have balconies."
There's plenty of riotous incident as Granny escorts her protegée on a long journey, replete with jaundiced reappraisals of fantasy clichés, to storm the gates of all-male Unseen University. Here the wizardly academics take themselves very seriously indeed:
"...He's an Eighth Level wizard and a 33o mage, actually."
"You mean he's bent?" said Granny.... "They all call themselves the Lord High This and the Imperial That, it's all part of the game. Even magicians do it, you'd think they'd be more sensible at least, but no, they call around saying they're the Amazing-Bonko-and-Doris."
Which indicates that Pratchett isn't averse to anachronistic humour (unwanted thoughts arrive in Esk's mind "like the unexpected limbo dancer under the lavatory door of Life"): but he doesn't let the one-liners wreck his story logic. This continues amusingly and semi-predictably within the portals of Unseen, where an innocent mathematical theoretician is meddling with barriers sealing off the very nasty Dungeon Dimensions, full of those hungry uglies described in the unspeakable Necrotelecomnicon or Liber Paginarum Fulvarum:
"The whole thing had a self-assembled look, as if the author had heard about anatomy but couldn't quite get to grips with the idea."
The conclusion features an oddly chilling confrontation with such Things, a partly relevant duel of sorcery, and some final philosophizing about the use and non-use of magic which carries an Earthsea-like conviction. Naturally, Esk and Granny manage to save the day. Without being as continuously and unremittingly funny as the first two Discworld episodes, Equal Rites is a pleasant read which steers a wobbly but just successful course between anarchic breakdown (whereby the reader is reduced to waiting glumly for the next joke) and taking its plot too seriously. It's unsafe to analyse light humour any more deeply than this: Pratchett's ultimate secret lies in the fact that without betraying earth-shaking literary genius, his writing is unpretentious and likeable. With a firm grasp of realities, too: there's instant conviction in the labels Granny laboriously writes for her potions, typically running:
"Dylewt in won pint warter and won droppe in hys tee and be shure to wear loose clowthing allso that no visitors exspected...."