What do i say to my friend whos suicidal and sounds like they are ready to come out??

I have a friend who randomly texted me tonight really upset. Aparently someone told them they havent had a girlfriend in awhile so they must be gay (i know i know, makes not sense). He was so upset (to be honest hes always been kind of homophobic) and went on to tell me how hes scared hes gay and would literally rather die then be gay. I told him theres nothing wrong with being gay and that its not a death sentence. That i have gay friends and its made no diffence on our friendships. Hes so upset and i cant tell if hes trying to tell me hes gay or if hes really just upset that maybe hes being bullied? He has always been bullied and ive ALWAYS stuck up for him. He doesnt want me confronting the person that brought all this up in the first place so ill respect that but please can anyone tell me what i should say to help him. I dont care if hes gay or not it, it would NEVER MAKE A DIFFERENCE TO ME. i just dont want him to do anything stupid. Hes hit rock bottom before. He has no job, no girlfriend and not may friends. I want to help him but he doesnt listen to my advice.