There are many things you can say to a friend, whose marriage is ending, as in this situation, the person needs someone to stand by him, you can say:
I’m sorry things end in this way.
Don’t worry everything will be Ok.
You are a wonderful person, i’m sure your new life will be great.
What about having a trip together?
I know you are sad, but it is a temporary feeling, you will feel better soon.