Twelve year-old Ricka, an orphan at Alston Manor School for Girls, has been ordered to bring up food from the cold, dreary cellar. She grips her lantern tightly as she descends the stone stairs, terrifed that her lantern will go out and that she will be stranded in the dark.
Ricka's fear of the dark goes back to her earliest memories, back to the time when Ricka's parents, in an effort to save her tiny daughter from marauding soldiers, hides her under the loose floorboards of their small apartment. After two days of black, near freezing conditions, Ricka's crying is finally heard by one of the remaining neighbors, and she is rescued from the grave she had been too small to escape from by herself. Years later Ricka learns that her parents have died in a concentration camp.
As Ricka takes her turn helping in the orphanage kitchen, she tries to help her friend, Mary, who suffers from crippling arthritis. The girls work diligently to avoid the wrath of headmistress Helga who looks for ways to punish everyone except her own daughter, Nora, who constantly receives preferential treatment.
In addition to being the Headmistress, Helga is also the only teacher for the small group of girls, and the girls soon realize that Helga knows little about the subjects she pretends to teach. Occasionally the school enjoys a visit, though, from Herr Zimmerman, the Director of Libraries for Ambria. Herr Zimmerman delights in explaining the history of Alston Manor where the orphanage is now located, and also brings books and other items that he hopes will enrich their meager lives. The girls especially enjoy the folklore that Herr Zimmerman relates to them, including the story of Queen Lorinda who disappeared over 400 years earlier and is supposedly banished by a wicked sorcerer to live forever in a magic lamp. Before he leaves the orphanage, Herr Zimmerman lends each girl a book and instructs them to read it and then pass it on to the others.
Nora steals Ricka's book before she has had a chance to finish reading it, and a fight ensues between the two girls. Headmistress Helga takes her daughter's side and punishes Ricka by banishing her to the unlit cellar for three days. Ricka uses her survival instincts and makes herself comfortable, eventually finding an ancient leather case that contains six small brass lamps. She lights one of the lamps with matches she has hidden in a pocket, and discovers that the spirit of Queen Lorinda does indeed live inside the flame. The Queen instructs Ricka to place the lamps in various areas of the orphanage, and shows her how to travel from room to room through the magic of the flame.
Two thieving brothers decide to use Alston Manor as a hiding place. The thieves tie up the headmistress and lock up the girls. Ricka scares off the theives by dressing as the ghostly Lorinda. In the meantime, Herr Zimmerman returns to the school because he realizes the uncanny resemblance that Ricka has to his dead sister-in-law. With Ricka's help he uncovers the financial scam that Helga has been using to run the orphanage. He also confirms, through files hidden in Helga's bedroom, that Ricka is his niece Erica.