I lost a baby at almost 7 months pregnant. I know how she feels.
Go to Mend.org. It is a great resource for what to say and what not to say to grieving parents.
Ask her how you can help her. Call her often, even if you tell her to call you when she needs it, and let her talk if she feels like it. Don't do all the talking, in other words. And be prepared for up and down emotions. One day she'll be fine and the next day she'll bit people's heads off. Put your thick skin on when you talk to her but just let her know you are a faithful friend.
Invite her to come with you to the grocery store, so she doesn't have to go alone the first few times, if she goes with you. Just call her up and say "I'm going to the store in an hour to grab a few things, would you like to come with me? I can pick you up".
Offer to drive her to the cemetary in the next few months. You can bring some flowers wrapped in pretty pink ribbon so she can leave something at the grave during those visits.
B/c I've been through this, I have confidence to ask other mothers after time has passed if they've thought about their baby that day. The mothers I've asked always seem to appreciate me asking this.
Find out her due date and remember her on that day by checking in on her or doing somethign special to remember her baby. Also mark your calendar for the baby's birthday aka the day she died.
My thoughts are with your friend.