The verses in question are:
Revelation 20:12 And I saw the dead, small and great, stand before God; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works.
Revelation 20:15 And whosoever was not found written in the book of life was cast into the lake of fire.
The book of life here is also called "the Lamb's book of life" (Revelation 21:27) or "the book of life of the Lamb" (Revelation 13:8). This is the book of names of those who are saved and have a place in heaven. Notice that in Revelation 20:15 (above) those who were cast into hell received this judgment because their name was not in the book of life.
The "books" mentioned in verse 12 are in addition to the book of life. They are the object of your question. Notice two things about them.
What was written in the books told of their works. That is, the books were the books keeping an account of the works of the people being judged. They were a record of their works.
- These books were used to judge those who did not have their name in the book of life. They were not used to determine whether or not someone was saved. Rather, they were used to determine the punishment they were to receive. Christ taught in Luke 12:41-48 that the servant who knew the Lord's will and did not do it would receive "many stripes" (v.47) while the man who knew not would receive "few stripes" (v.48). Certainly, we do not understand all the implications of this teaching, but it clearly teaches that there will be levels of judgment for the lost. In this parable, the unworthy servant is appointed his portion with the unbelievers (v.46), so we can say that he is lost.