What do you say to a friend when he tells you he is getting a divorce?

Whatever you feel. However, it is common to give him advice to "be able to move on and forget about it" and something along the lines of "you could do so much better". Your friend would like some reassurance and just a bit of friendship is the key. Keep them distracted and give some memories of past to make him feel better. After that, just treat him properly.