The Lord of the Rings

 was either a book or a series of books that I.M. Foreman had been reading soon before meeting the Eighth Doctor. When the Doctor mentioned having been travelling with someone named "Sam", she was reminded of a character from The Lord of the Rings.