"I'll bet she's enjoying this," the surgeon said and winked as he prepped a naked, anesthetized woman for a hysterectomy. The medical student at his side cringed, nervously echoing his superior's laughter. Later, in a medical humanities class, he declared the surgeon's behavior "unforgiveable"—and asked the professor if he had ever witnessed anything like that.

Worse, the professor told his class; he had taken part. For years, he had bottled up his own offence, an obscene dance involving an unconscious woman who had almost died after having a baby. On Monday he broke his silence. In the journal Annals of Internal Medicine, he described both patient encounters in an anonymous essay on what the editors call medicine's "dark underbelly"—a realm where outwardly caring doctors behave with disrespect toward unsuspecting patients.

"The incidents described in this essay are completely abhorrent," the journal's editor in chief, Dr. Christine Laine, of Jefferson Medical College in Philadelphia, says. "What makes them especially abhorrent is that they were done in front of trainees. That magnifies the wrong."

In the second case, the patient, identified in the essay by the pseudonym "Mrs. Lopez," had begun to hemorrhage after giving birth. The obstetrics resident on the case saved the patient's life by giving rescue drugs and by manually massaging the woman's uterus to restore its muscle tone and stop the bleeding. Afterward, with his hand still inside the patient, he began singing "La Cucaracha" and dancing. The professor—then a trainee—joined in. Appalled, the anesthesiologist, who had put the woman to sleep, intervened, saying "Knock it off, a--holes."

The journal's editors say the author is a practicing physician with a medical school affiliation. Although he signed his essay when he submitted it, they chose to publish it anonymously to avoid identifying "any person…most importantly the patients." They make no effort to sugar-coat the incidents described. In an editorial, they characterize the first as reeking of "misogyny and disrespect" and the second "of all that plus heavy overtones of sexual assault and racism."

These incidents may seem extreme, but they are far from unique or limited to any specialty. In June, a Fairfax County, Virginia, jury ordered an anesthesiologist and her practice to pay a patient $500,000 after the doctor mocked and insulted the patient during a colonoscopy. The comments were recorded during the procedure on the patients' smartphone. Last summer, Johns Hopkins Health System agreed to pay $190 million to settle the case of a gynecologist who was fired in 2013 for secretly photographing and recording patients. After the doctor confessed, he committed suicide.

Dr. Deborah Hall, president of the American Medical Student Association, notes that medical licensing boards report that more complaints are filed against physicians for a lack of professionalism rather than medical malpractice. "It's our behaviors and the way we treat patients," she says.

The journal's editors acknowledge that incidents in which doctors behave unprofessionally towards patients may be more common than most doctors like to admit. "Although we wish it were otherwise, most physicians at some point find themselves in the midst of situations where a colleague acts in a manner that's disrespectful to a patient," they write in the editorial.

What makes the essay so troubling, and so compelling, is what it says about the culture of medicine, experts say. It is a hierarchy, with the doctor at the top, often with little tolerance for criticism by medical students, residents, nurses or other subordinates.

In both of these incidents, patients were in the maelstrom of complex procedures, one a hysterectomy and one a delivery. Both rooms would have been populated by doctors, nurses and technicians. Medical students feel as though they're at the bottom of the pecking order, says Hall, a recent graduate of the University of Connecticut School of Medicine.

"Students feel incredibly vulnerable," Hall says. "It's incredibly difficult to speak up." Yet students who don't speak up, she says, experience a sense of shame. "That's a heavy burden to carry. It can contribute to burnout and a decline in compassion."

Another dimension is the difference between how the second incident began and how it ended. It began with a life-threatening crisis in which the participants acted quickly, and responsibly, and saved a mother's life. And the physician who deserves credit—and ultimately blame—was trainee himself, a doctor working to become a specialist in obstetrics and gynecology.

"This was a resident, not an attending physician," says Dr. Sigal Klipstein, chairwoman of the American College of Obstetricians and Gynecologists' ethics committee and a reproductive endocrinologist at InVia Fertility Specialists, Hoffman Estates, Illinois. "This could have been a 27-year-old kid in a situation where a patient's life was literally and figuratively in his hands."

The author of the essay offers virtually no commentary and renders no judgements on the behaviors described. He simply sets the scene—a class in which the topic was "forgiveness"—and relates what was said. After finishing his own story, he writes that he glanced at the students sitting speechless before him and concludes with one telling line:

"I know this is my silence to break."

The journal's editors report that they decided to publish the essay only after a debate so impassioned that, at one point, they decided to take a "time out."

Dr. Darren Taichman, of Penn Medicine and the journal's deputy editor, says some editors were fearful that by publishing the piece they would tarnish the profession or, worse, "make patients fearful about what might occur behind their backs, so they're reluctant to get the medical care they need."