Alex: as a gay man who came out as an adult, I urge you to reach out to your closeted friend. Let him know that Facebook violated his privacy and you accidentally and unexpectedly came across his secret. Reassure him that you care about him as a friend and that his sexuality makes no difference to you.
Unless he is in physical or serious financial risk from coming out, his life will be unimaginably better if he comes out. If he's going to lose his job or be disowned by his parents, at least having one friend to share his secret with may make a world of difference.
If he has a girlfriend or wife, for her sake, you need to reach out to him. It's an incredibly awkward situation, but think about what an enormous positive difference you can make in one or two people's lives.