Once upon a time, in my high school Lit class, whenever we had to write an essay in class (known as Blue Books, because of the ominous baby blue booklets we had to write them in), we were expected to quote the test five times, minimum. And we weren't allowed to have the book with us. What that basically meant was that the day of the Blue Book, there'd be a bunch of us nerds walking around with flashcards that said things like, "Penelope and Women" or whatever. Basically, "[Insert Character Name] and [Insert Name of Theme That We Might Have to Write About]."
Some of the quotes were boring as all heck, which made them a pain to remember for the exam and no one remembered them afterward. Some were a strange experience to learn, so we remembered them easier. ("Holding all I used to be sorry about like the new moon holding water," -- Quentin, The Sound and The Fury. Apparently an old superstition held that the new moon could tell you if it would be a wet month or not.) And some were just so much fun you couldn't help remembering them. (Grendel's mother in Beowulf is known as "swamp thing from hell." Now tell me you wouldn't laugh aloud at that. And I can personally guarantee that at least 80% of my class used the quote "Once a bitch, always a bitch," in their essay on The Sound and the Fury.)
To what does this tend, you might ask? Well, while I'm not sure if I'd ever want my books to be the subject of a literature class (that would basically mean that 85% of the kids resented me and were cursing my name), I would love to be an author whose words worked their way into the readers mind with no intention of ever leaving again.
So, what makes a line memorable?
I'm sure figurative tricks can help a great deal. While I don't remember a great deal from that class that was heavy on alliteration, the rhyme of a poem does make it easier to remember. Also, repetition. I never did count the number of times that Athena is called "silver-eyed Athena" in The Odyssey, but believe me, three months later, we still knew what color her eyes were.
Humor is much harder to forget than anything else. My friends and I used to quote Hamlet in the hallway. (Gertrude: "Hamlet, thou hast thy father much offended. " Hamlet: "Mother, you have my father much offended." Yes, even Shakespeare believed in bitch-slapping people.) Yeah, we were geeks, but when you've been reading Shakespeare for a few hours and you're already a bored high school student, anything funny goes a long way. Basically, people reading books are often tired or bored or stressed, so humor is always much appreciated.
Don't be afraid to tug on heart strings either. If a line is exceptionally moving, the reader will remember that. One of my favorite lines in Ender's Game (Come now, you didn't seriously think I could go a whole post on books and not mention it, did you?) is Alai talking to Ender when they're about to be separated: "Always my friend, always the best of my friends." Even now, I do a little 'aaww' when I read it. And there are other lines that are the same way. Your reader, hopefully, is going to remember the emotional scenes you right. They can also remember the emotional lines that went in them.
The thing that always made lines memorable for me was that they were contrary to what I expected. I don't think anyone who opens The Sound and the Fury to Jason's section expected the words, "Once a bitch, always a bitch," as the opener. (And watching kids try to do a presentation on that section without using the word was one of the funniest things I've ever seen.) And while I still remember Agamemnon saying, "The fame of her [Penelope's] great virtue will never die," -- because you could use it anywhere -- I don't think any of us are going to forget Helen's words, "Shameless whore that I was." Somehow, you just don't expect that in school assigned reading.
The best way, it seems to me, to grab your reader's attention on a line is to controvert what they expected, to amuse them with it, or to hit an emotional note with it. Anything that makes your reader laugh aloud or perks them up after they've been lying on their bed for fifteen minutes or illicts an emotional reaction will stick in their head much longer.
What are some lines from books you don't think you'll ever forget?