"And I saw a great white throne, and him that sat on it, from whose face the earth and the heaven fled away; and there was found no place for them. 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:11-12)
This is the second resurrection. The blessed of the first resurrection will not take part in the resurrection described here. This resurrection is reserved for the damned. The Scriptures have foretold of not only a resurrection of the just but also of the damned. "And many of them that sleep in the dust of the earth shall awake ... some to shame and everlasting contempt (Daniel 12:2)." Jesus said, "...The hour is coming, in the which all that are in the graves shall hear his voice, and shall come forth ... they that have done evil, unto the resurrection of damnation (John 5:28-29)."
Outside of Christ's righteousness, each person will be judged not according to the merits of the sinless Savior but according to the merits of his own insufficient and evil works. The one who resists the grace of Jesus Christ will receive the graceless reward of his own works (Psalm 143:2, Romans 4:4, James 2:10).
"And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works. And death and hell were cast into the lake of fire. This is the second death. And whosoever was not found written in the book of life was cast into the lake of fire." (Revelation 20:13-15)
"The last enemy that shall be destroyed is death (I Corinthians 15:26)." Prior to being sentenced herself, death will be required to surrender the last of her victims. These souls will then be judged by their own faulty merits and consigned to the lake of fire. The lake of fire would seem to be the zenith of eternal damnation since death and hell are seen being cast into it.
The Almighty keeps perfect records. He knows His own. God's memory is flawless. He does not need records, but He keeps them as a testimony to man. Other Bible passages speak of these heavenly records (Exodus 32:32-33, Philippians 4:3).