In this situation, it is important to be available to him as a friend for emotional support. If he needs to talk (or vent) then lend him an ear and let him speak his mind. Once his emotions are under control, be a moral support in court.
I would also suggest directing his focus to attaining the legal assistance he needs. Help him find an attorney (if he can afford one). Help him steer his focus to studying probate laws for the state that the divorce will be held in. A book that I would highly recommend for him to borrow from his local library is "Fathers' Rights Hard Hitting and Fair Advice for Any Father Involved in a Custody Dispute" by Jeffery Leving and Kenneth Dachman. It will prepare him for what to expect in court and the battle ahead.
Best of luck!