"I just want you to know that I'm thinking about you." If you offer help - try to be specific like offering to have the children if there are meetings with lawyers etc.
"I'm sorry. I didn't know" . (Avoid giving advice!)
It's good to acknowledge it's stressful even if your friend is relieved.
Be supportive. Say "You're going to get through this difficult time."
Wish your friend the best - rather than mourning the end of the marriage. "There's a whole new world ahead of you."
On a practical side, don't ignore the person while they're in the midst of a divorce. Still invite them to lunch with the girls or out on a Saturday night with other couples. The biggest complaint from divorcees is that their social life takes a nose dive during/after a divorce and they would have appreciated a few invitations to get them out.
What not to say
Don't ask whose idea it was or who was to blame. It's human nature to be interested but it certainly won't benefit your friend to take the conversation in that direction.
Don't ask personal questions like "What did you do with the house and the cars?" "Are you lonely?" You might be interested but again, it'll make your friend feel sad.
Don't be overdramatic. "Oh, my god! How are you going to handle this?" There is a difference between sympathy and pity.