The thought experiment was originally proposed by Frank Jackson as follows [in 1982]:
Mary is a brilliant scientist who is, for whatever reason, forced to investigate the world from a black and white room via a black and white television monitor. She specializes in the neurophysiology of vision and acquires, let us suppose, all the physical information there is to obtain about what goes on when we see ripe tomatoes, or the sky, and use terms like ‘red’, ‘blue’, and so on. She discovers, for example, just which wavelength combinations from the sky stimulate the retina, and exactly how this produces via the central nervous system the contraction of the vocal cords and expulsion of air from the lungs that results in the uttering of the sentence ‘The sky is blue’. […] What will happen when Mary is released from her black and white room or is given a color television monitor? Will she learn anything or not? 
If she learns something new, then, supposedly, immaterial qualia exists. Check the arguments for and against on wikipedia, Mary’s Room.
Now, this is my materialist solution:
She has only received stimuli that affect neurochemistry telling her that the sound “blue”, how it is muscularly pronounced and all the other things she reads or hears about blueness belongs to 475 nm wavelength photons as reflected by objects. She has not received the photon itself so the neurochemistry will be completely novel and the experience therefore also novel. However, this doesn’t say anything about whether qualia is immaterial or not, it is stricly a material formulation of the dilemma. To me, qualia is knowledge, so it’s wrong to differentiate between the two and ask whether she knows about the qualia or not because the knowledge existing in the auditory neurochemistry is impossibly the same knowledge that exists in the visual neurochemistry, i.e. no matter how much you know about vision, that knowledge exists in neurons that are impossibly the same neurons as the neurons in the optic nerve. If the neurons in the optic nerve are never stimulated by the retina but used only in an auditory network, then they’re not really an optic nerve now are they. The quality of qualia relies on what the senses are capable of sensing because the mind IS the physical senses, so knowing/experiencing visual qualia of a blue car is an electrochemical activity behind the retina that is different from the visual qualia of reading a text about blue car visual qualia and different from the auditory qualia of being told what qualia is.
It’s actually just a matter of spotting the error in the premise. Knowing everything about anything is impossible, but even if Mary knows terribly much through all kinds of experiences she doesn’t know the experience of photons on the retina, not only does she not know what it “feels like” but she has never had the physical experience and thus not the physical knowledge of the photon hitting the retina. So, even though her brain has learned the word blue and all other things that have entered her brain, she hasn’t learned the blue photon hitting the retina because it has not hit yet. This means the premise is false, she doesn’t know everything there is to know about colour.
An interesting side note is that learning is a physical process of growing relative connections in the brain through sensing outside stimuli and working with internal stimuli (like the neurology constituting a memory that fires and causes happiness). The older you get the less of the original structure remains and the original structure [see Chomsky on language] is designed to make sense of colour stimuli so given enough time a monochrome or blind person can’t neurologically adapt to and make sense of colour stimuli. We see the same deterioration of ability to decipher auditory stimuli in grown-ups with cochlia implants. It might be too late for Mary to see colors well or at all.
A second side note is that she might be so well educated in photon wavelengths that she will think it folly that some people use so few words to describe the differences. Of course, learning means differentiating between stimuli so even assuming she still has the ability to learn colour vision at old age it will require some biological time for the neural pathways to build up connections with the linguistic centre and memories and so on, but once she’s done that, also given her extraordinary interest in the matter, she might refrain from using “simply red” to denote a colour and emphasize the differences between shades of red by giving each wavelength a unique name. Psychologically this seems like a likely response to someone who’s been locked-up in a monochromatic prison for a few years and learnt everything there is to know about colour.