Christian thinkers, on the other hand, viewed men's genitals in a decidedly grimmer spiritual cast. To St. Augustine, the organ was a lever of sin: ''the demon rod.'' Semen itself was a toxic glue, effectively damning both men and women to a state of sin, a neat one-two punch that rendered sex dirty by definition. Erections were less spiritual highs than demonic jolts, an interpretation that was to ripple through much of Western culture. The high point of witch trials, Mr. Friedman notes, was inevitably a shocking genital revelation: the defendant's confession that she had copulated with the devil's penis, an object sometimes spiked, sometimes forked, but inevitably ice-cold.

Once Victorian scientists got to work, things got even messier. Over the years, doctors had developed a better sense of how the organ works. (Some early medical authorities believed that the two sexes shared the same anatomy, with women simply lacking the creative heat to keep their phallus popped outside; others assumed erections were filled with air.) But a more sophisticated mechanical understanding did not translate to gentler treatment. Indeed, having transformed a Christian sense of sin into a more modern concept of disease, doctors cheerily set about fixing terrible ailments like teenage masturbation, wreaking havoc indescribable in a family newspaper. (Leeches were one of the nicer options.) And then there's Freud, who viewed the penis as a fulcrum on which psychological health balanced, particularly (and problematically) women's psychological health.

But perhaps the most unsettling chapter of Mr. Friedman's book deals with the Western obsession with the black man's penis. White men's fascination with the supposedly monstrous genitals, Mr. Friedman documents, has long occupied the irrational center of American racism, from the gruesome sexual torture of lynchings (recounted here in horrific detail) to Robert Mapplethorpe's worshipful but objectifying fascination with his photographic subjects. ''It was stared at, feared (and in some cases desired), weighed, interpreted via Scripture, meditated on by zoologists and anthropologists, preserved in specimen jars and most of all calibrated,'' Mr. Friedman writes. ''And in nearly every instance, its size was deemed proof that the Negro was less a man than a beast.''

Feminist scholars have long denounced Western culture's punitive prurience regarding female genitals, and Mr. Friedman's book shows that the same is true for men's bodies. It's a useful corrective. The author himself is neutral in many of the debates he raises, be it Andrea Dworkin's opposition to pornography, the sociobiology of rape, Viagra or Andrew Sullivan's insistence that testosterone is the essence of manliness.

But the painful history that Mr. Friedman recounts suggests that while the culture has largely bypassed archaic notions of sin and disease, the penchant for self-improvement may harbor its own hidden danger: the desire to make perfect at any cost. Seen in this light, Viagra and interest in cosmetic surgery may one day seem like a case of ''be careful what you wish for.'' The moment the guesswork is taken away, the penis is transformed again: from the ghost in the masculine machine to a soulless but reliable tool.