Let him know that you are willing to talk if he wants to, and that you will not judge him, and that it greatly helped you, or would have, to have someone to talk to.

If you think he might get offended by you indirectly suggesting that he is gay, then maybe you should be much more subtle about it. Maybe start by probing and ask him if you could ask a somewhat private question (without prejudice), and then ask him if he ever had feelings for another man. Or you could try a semi-serious, half-joking, half-curious approach. If he seems to be somewhat positive, or somewhat open to discussing it, then you can make the proposal in the 1st paragraph.

Though, In my experience, people generally tend to back off when asked about their sexuality, if they are being private about it, so I don't think you will have any success. However if you really want to ask then I tried to put it in a form where you would tiptoe and unsettle him as little as possible. Someone else might have a better idea, though!

I would mostly recommend the "developing your friendship and being available for whenever (and if) he is ready to talk about it" approach, proposed in another post.

As a straight man, I find it sometimes bothersome, even infuriating when a gay man marries a woman and is not honest with her about his sexuality. However, I understand that gay men can marry and have relationships with the opposite sex, and, although I'm all for honesty and transparency, it's not for me to judge.