It's metaphorical, and examining the context before the passage you cite can illuminate the meaning. I believe the light refers to Anna's outlook on the world, or her interpretation of external events. The book, then, is what she sees outside her--what's happening with & to the average people around her. (I'm working from the Pevear and Volokhonsky translation.)
Earlier, on page 766 in my version, Anna, in a miserable mental state and seeing only the worst in those around her, overhears a man and his wife talking on the train. The woman says, "Man has been given reason in order to rid himself of that which troubles."
'To rid himself of that which troubles,' Anna repeated. And, glancing at the red-cheeked husband and the thin wife, she realized that the sickly wife considered herself a misunderstood woman and that her husband deceived her and supported her in this opinion of herself. It was as if Anna could see their story and all the hidden corners of their souls, turning her light on them. ....
'Yes, troubles me very much, and reason was given us in order to rid ourselves of it. So I must rid myself of it. Why not put out the candle, if there's nothing more to look at it, if it's vile to look at it all?'"
So, the story of the man and wife constitutes a part of the "book" around Anna, and her "light" or "candle" represents how Anna views the stories of the people around her. Crucially, however, what this "light" reveals is vile, upsetting, dark, and ultimately more a reflection of Anna's depression than the truth about the people around her. She doesn't know the woman views herself as misunderstood; it's more a projection of Anna's own internal state, itself bleak, grim, despairing. (She is suicidal, after all.)
Finally, moments before Anna's death--the excerpt you cite-she crosses herself. Tolstoy writes:
The habitual gesture of making the sign of the cross called up in her soul a whole series of memories from childhood and girlhood, and suddenly the darkness that covered everything for her [projected from within herself outward, in my interpretation, like some kind of an anti-candle or bizarro lantern] broke and life rose up before her momentarily with all its bright past joys. ... And that candle by the light of which she had been reading that book filled with anxieties, deceptions, grief and evil, flared up brighter than ever, lit up for her all that had once been in darkness, sputtered, grew dim, and went out for ever.
I think it's a matter of debate and interpretation if the flaring up of the candle's light here, in Anna's final moment, actually reveals truth and beauty, a la her childhood recollections, or merely reveals in a harsher glare all the deceptions Anna had previously been fixated on immediately before her death. I'm inclined toward the former, that she attains a powerful spiritual realization in her last instant, brought upon by crossing herself. This could fruitfully be compared to Levin's spiritual realization and awakening that comes later, but that's beyond the scope of this answer, which is already far too sprawling and imprecise. I hope it helps and others can improve it.