In contemporary usage, the adjective gay usually describes a person's sexual orientation, being the standard term for homosexual. In earlier usage, the word meant "carefree", "happy", or "bright and showy", though this usage is infrequent today. Gay sometimes also refers to commonalities shared by homosexual people, as in "gay history", the ideological concept of a hypothetical gay culture, as in "gay music."
Science fiction (abbreviated SF or sci-fi with varying punctuation and case) is a broad genre of fiction that often involves speculations based on current or future science or technology. Science fiction is found in books, art, television, films, games, theater, and other media.
Fantasy is a genre that uses magic and other supernatural forms as a primary element of plot, theme, and/or setting. The genre is generally distinguished from science fiction and horror by overall look, feel, and theme of the individual work, though there is a great deal of overlap between the three (collectively known as speculative fiction).
Hence all of the above, gay science fiction and fantasy is a subgenre of both science fiction and fantasy which incorporates gay themes, often by way of the sexuality of the protagonist or a major character. It may have sexual imagery and aspects of science fiction erotica, or magical and supernatural aspects of it. It may also explore, in a wider scope, the varieties of sexual experience that deviate from the conventional.