She's now the ecstatic mother to daughter Blue Ivy Carter, nearly 13 months, but Beyonce dealt with the ultimate maternal anguish before that famous pregnancy: A miscarriage. Last year, the 31-year-old singer's husband Jay-Z briefly referenced the tragedy in "Glory," the rap track recorded within days of Blue's Jan. 7 birth, but Beyonce hasn't ever discussed the loss.

In a surprising moment of candor, she opens up for the first time about the incident and its aftermath in Life Is But a Dream, her new documentary debuting on HBO in February. "About two years ago, I was pregnant for the first time," the Grammy winner says in one scene. "And I heard the heartbeat, which was the most beautiful music I ever heard in my life."

She and Jay-Z (they wed in April 2008) were naturally overjoyed about their baby-to-be. "I picked out names," Beyonce recalls. "I envisioned what my child would look like . . . I was feeling very maternal."

But something went wrong in the early stages, the "Love on Top" singer reveals. "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."

The superstar (who will perform at the Super Bowl Half Time show this Sunday, Feb. 3) dealt with the heartache the best way she knew how: Through music.

"I went into the studio and wrote the saddest song I've ever written in my life," she says, although she doesn't name the track. "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."

All of which made her successful pregnancy with Blue Ivy all the more exciting and joyful. "Being pregnant was very much like falling in love," she muse. "You are so open. You are so overjoyed. There's no words that can express having a baby growing inside of you, so of course you want to scream it out and tell everyone."

After months of understandable secrecy, she finally did "tell everyone" — in one of the most Tweeted moments in history! — by revealing her bump on the red carpet at MTV Video Music Awards in L.A. Aug. 28, 2011. Later on in the evening, she rubbed her growing belly at the tail end of a lively rendition of "Love on Top."