Spoken from the vantage point of a gay man (I'm sure this is going to get me several "thumbs down" from the homophobic teenage trolls who are home from school for the summer and have nothing better to do than to get on message boards and make "fag bashing" comments):
If this is happening at work, let the gay man know that your workplace has policies against sexual harassment, including unwanted sexual advances and creating a hostile work environment. If his behavior doesn't stop immediately, go to HR and file a complaint.
He will be out of a job so quickly it will make his head spin. NO company wants to be on the receiving end of a sexual harassment lawsuit.
If it's not at work — try confronting the man directly, preferably with a group of people with you, so you have several witnesses. For him, the humiliation of something like this happening will be compounded by having several witnesses present) and confront him on his behavior, that it will stop IMMEDIATELY, and what the consequences will be if the behavior doesn't stop (protective order, etc.).
And whatever threats you make if the behavior doesn't stop, IMMEDIATELY — *DO THEM*. Do not make any threats you do not intend to carry out. (Obviously, you're not going to hit him, because he can turn around and have you charged with assault and battery.)