Well, I take it you're a female. All I can say is be his best friend.
I really like this guy from my school, we are really close but he just told me that he is gay. What so I do?
Technically, I have experience with this too cos a mate of mine is gay and he has one girl who is so close to them you'd think they're together. Well for your issue lets just say spend so much time with him he may turn back? Hope this may help but if not then keep close to him and it should work out