A lot depends on your budget. Unfortunately, nightlife in Rio is becoming very expensive. It also depends if you are just looking for things to do or are looking for traditional Carioca carnival type things. Monobloco in Lapa on Fridays is supposed to be good as is Margarte Mendez at Canacao on Tuesdays (expensive). Also don't forget the traditional carnival balls that will start a couple of weeks before carnival (Scala is the most popular place for these.) There has been mention of the blocos but they are not all gay oriented. First of all, you will often stumble into them by accident and you have to get in the spirit and just join in. My favorite is Sympatia E Quase Amor that is on Saturdays in Ipanema. OF course their is always the Stones on the 18th!
Read the papers, they are much better at publishing these events than they used to be. I've been traveling and just got back into town so I'm not totally caught up yet.
Here are a couple of sites that have some info:
http://www.riofesta.com.br/
http://www.funrio.com.br/
http://cidades.terra.com.br/rio/0,,,00.html
Also, don't be afraid of Farme. There is a 24 hour police trailer between there and favela entrance.