Is calling a homosexual person “gay” offensive?
Solution 1:
The adjective gay is the most common term, at least in the U.S., and is not offensive on its own. (It can be used offensively, of course, by using it as an insult, or even as a generic pejorative — "my English class is so gay!" — but then the offensiveness is in the implication that gayness is an insult, rather than in the choice of gay as the word for gayness. It can also be used offensively in more subtle ways, such as consistently describing someone as "my gay friend", but again, that's not tied to the specific word gay at all.)
The noun "gay", however, is generally used only in the plural (e.g., "allowing gays to serve in the military"); use in the singular is very rare, and it's hard to guess whether someone would take ?"he's a gay" to be offensive. (The same is true of many other adjectives, such as "white" and "black"; "American blacks" is fine, ?"she's a black" is not.)
Incidentally, although homosexual is a more formal term, it may actually be more likely to be offensive; for example, if you compare the Google-search results for "gay rights groups" to those for "homosexual rights groups", you'll see that the latter has a much higher proportion of disparaging uses from the right wing (though this is far from categorical). I think this may have something to do with the history of homosexual as a clinical term for a putative mental illness.
Solution 2:
"Gay", on its face, is not a derogatory term. It's typically preferred by those to whom it applies over the term "homosexual", the technical nature of which makes this state of being sound like a communicable disease or mental illness (which, as recently as the DSM-II, seventh edition, it was, categorized as a pathological phobia of the opposite sex). In common parlance it is used more to refer to men (the term "lesbian" being gender-specific to women) but can be applied to either gender. Many advocacy groups, such as GLAAD (Gay/Lesbian Association Against Defamation) and terms they promote for use in the media (such as LGBT) incorporate this term.
Now, any identifying term for a subset of the human population, especially those identifying a trait of the subset not shared by the majority, can be derogatory. It can be said in a condescending way, or in printed form it can be used in an unflattering context. The same words, on the other hand, can also come to be "owned" by the group of people to which the term refers, and when said by a member of that group to refer to themselves, it's acceptable to some degree even if the term is extremely offensive if said by anyone outside that subset.
These can be known as "inside" terms, whose use is only acceptable when used by a member of the group to refer to themselves or another. Many people will know the one I'm pointedly avoiding, referring to African-Americans, but this term is not unique in that category. "Queer", an old slang term for gay men, and "fag"/"faggot", originally AE slang for a wimp or unmanly person, but which came to be associated with the stereotypical "swishy" gay man, have become inside terms; still inappropriate when used by a neutral party or a "straight" person, but acceptable in context between gay men.