http://esr.ibiblio.org/?p=1192#more-1192
ADDED: Even if you disagree with ESR's take, and many will, this is the clearest definition I have seen on what qualia is. So it should present a useful starting point, even for those who strongly disagree, to argue from.
Mary's Room is invalid because it sneaks in a false assumption: that if something is knowledge, then it can be learned by study alone. As a counterexample to the story of Mary's Room, consider the story of Marty's Bicycle, which I have just made up.
Marty is a brilliant physicist who has suddenly become very interested in bicycles. Unfortunately, his leg is in a cast, so he can't ride one. While he waits for it to heal, he studies their physics, watches people ride bikes, reads guides on bike riding, and interviews top racers - in fact, he studies everything there is to study about bicycles. When the cast is finally taken off, he buys a bicycle, gets on, and immediately falls over.
The ability to recognize red objects is like the skill of riding a bicycle - it can only be acquired by doing it, not by study, because study can only train the linguistic centers of the brain, not the visual processing centers (Mary's room) or the balance centers (Marty's bicycle). This is merely an accident of how our brains work; one could easily imagine a robot that could be told how to recognize red objects or balance a bicycle without having to try it first.
This applies to humans, who have fixed systems for different kinds of learning. If marty or mary were AI's they should be able to gain abilities through knowledge directly.