Beyonce had a miscarriage prior to having her daughter Blue Ivy Carter. Jay-Z briefly addressed it on "Glory." But now the singer herself opens up about the unfortunate event in Life Is But a Dream, her documentary that will be airing on HBO in February.

"About two years ago, I was pregnant for the first time," she says in the doc. "And I heard the heartbeat, which was the most beautiful music I ever heard in my life."

Bey says that her and Jay-Z were excited about their forthcoming bundle of joy.

"I picked out names," Beyonce recalls. "I envisioned what my child would look like . . . I was feeling very maternal."

But then things went awry.

"I flew back to New York to get my check up -- and no heartbeat," she says. "Literally the week before I went to the doctor, everything was fine, but there was no heartbeat."

How did she deal with the loss? Like a true creative.

"I went into the studio and wrote the saddest song I've ever written in my life," she says, though she never indicates which song it is, specifically. "And it was actually the first song I wrote for my album. And it was the best form of therapy for me, because it was the saddest thing I've ever been through."

More From TheBoombox