Hi,
I had a question about the ad you posted on Craigslist. I was interested in the house's location, but I was wondering if the current resident is male or female, and whether he/she is looking for a male or a female roommate (if there is any preference)?
Thank you for your time,
Jane Doe
The nice thing here is that it leaves open several possibilities, which makes it less awkward:
The person who wrote the ad is not the same as the roommate.
The person email recipient is not the same as the one who wrote the ad (or the roommate).
The person email sender (you) is not the same as the one looking to occupy the room.
In particular #3 is important because it is equally possible that you may be looking for someone else, which I think would subconsciously make people more understanding and willing to respond—perhaps because it keeps the issue a bit distanced from both parties, and hence less likely to cause offense.
(Obviously, make sure all of these make sense. If the ad already specifies some of these, try to remove that ambiguity from your email so you don't look clueless. But keep the others in.)