As many as 1 in 5 pregnancies ends in miscarriage, so odds are you'll probably be in this position sometime if you haven't been already.
Women who've lost a baby need to develop a hide made out of Kevlar to deal with some of the things people say. Nobody purposely tries to be an insensitive creep, but sometimes less-than-helpful words just get blurted out.
Don't Say: "What a bummer."
When I called my OB's office after my third miscarriage, the receptionist said in a very sympathetic voice, "Ohhh, that stinks!" I know she meant well, but come on. Miscarriage is devastating, and it hurts even worse when people trivialize it. It's a bummer when your ice cream falls out of the cone; it's not what you say when someone's baby dies.
Try Instead: "I'm so sorry."
Your friend lost a real baby and she's grieving. You can't change the situation, but you can treat it with the respect it deserves. Let your words, your tone of voice, and your facial expression show it. After my miscarriages, it was a huge relief just to talk to anyone who understood even a little how deeply it affected me (and would for the rest of my life.)
Don't Say: "Are you going to try to get pregnant again?"
This is literally the most inappropriate time to be asking that question. Literally. It's like asking a new widow at the funeral if she's going to remarry. And I hope you would never do that. It's too early for a woman having a miscarriage to be thinking that far ahead; and even if she is, it's none of your business.
Try Instead: "Can I bring you dinner tonight?"
If you want to ask questions about the future, find out when you can bring over a meal this week. Miscarriage isn't just an emotional trauma, it's physical, too. Trust me, she isn't going to feel like cooking for a while. If she has other children, could you take them for an afternoon or drive them to soccer practice today while you're at it?
Don't Say: "Maybe it wasn't meant to be."
Even if she's a religious person who also believes that God has a bigger plan, she's hurting right now. A sincere "I'll pray for you" would be okay, but proclaiming that her loss was God's will is pretty presumptuous of you. And it makes you sound like sort of a jerk.
Try Instead: "How are you feeling?"
Really, the only thing you can do is listen, so give your friend a chance to talk. Depending on your relationship and what's going on with her at the moment, she might not want to. But if she does, try rephrasing what she says, asking questions, and avoid making any judgments or conclusions.
Don't say: "At least..."
At least what? At least anything. Not "at least you know you can get pregnant," not "at least you were only 7 weeks," and not "at least you have children already." She's allowed to say that stuff if she wants to, but you keep your mouth shut.
Try Instead: Give a hug.
If you want to comfort a friend who's lost her baby, give her a hug. She doesn't need you to point out the silver lining, she just needs to process her feelings and knowing that you care will make it easier.
The most hurtful responses to my miscarriages were the ones that dismissed the genuine loss I was feeling. So a good rule of thumb is to ask yourself, "Would this be appropriate to say if she was experiencing the loss of a child who'd already been born?" The last thing you want when you're attempting to be sympathetic to your friend's pregnancy loss is to come across sounding like a dirtbag.