Much more important than what to say is what NOT to say.
Do not under any circumstances say things like she's young and will have other children. This is the most hurtful thing that can be said. She just lost a child, and hearing a friend or family member say that her baby is so easily replaceable is very hurtful.
Do not remind her that a miscarriage means "something was wrong with the baby." She does not want to hear that the precious baby she was waiting for was somehow damaged.
Do not refer to the child she just lost as "it." This was her son or daughter.
If the miscarriage is not new and you wonder why she hasn't tried to conceive again, keep it to yourself. She may be trying and very sad that she hasn't been able to become pregnant again.
Do not think that if you have children of your own, it will be some kind of magical cure-all for her to hold them or baby-sit for you. Children may generally make people feel happy, but not someone who just suffered the loss of her own.
Do not say things like "I know what you're going through" if you have never lost a child and thus have no possible way to know what she is going through.
And for a "do" among all these "don't" suggestions, do offer to help her find a support group of people who have suffered a similar loss if she agrees to it. This is often beneficial in getting through the first few weeks or months, to spend time with people who truly do know what she's going through.