The spirit of Cain is the spirit of jealousy and self-righteous works which ultimately led to outright murder time and time again throughout the Bible, beginning with Cain murdering his brother Abel in a self-righteous fit of rage, because Abel's sacrifice was pleasing to God, while Cain's sacrifice was not. This is the spirit of Satan himself, or as the Apostle John writes concerning Cain, "who was of that wicked one". In John chapter eight, and other verses which follow, Jesus is accusing His unbelieving Jewish oppressors of being of that very same spirit -- that is, of the Devil and Satan -- because Satan is the one who inspires jealousy, unbelief, self-righteousness and murder. That same satanic spirit was behind the murder of Abel, behind the murder of many of the Old Testament Prophets, behind the murder of Jesus, and behind the murder of His followers in the New Testament as well. It is one and the selfsame spirit:
"Ye are of your father the devil, and the lusts of your father ye will do. He was a murderer from the beginning, and abode not in the truth, because there is no truth in him. When he speaketh a lie, he speaketh of his own: for he is a liar, and the father of it."
John 8:44, KJV
"Wherefore, behold, I send unto you prophets, and wise men, and scribes: and some of them ye shall kill and crucify; and some of them shall ye scourge in your synagogues, and persecute them from city to city: That upon you may come all the righteous blood shed upon the earth, from the blood of righteous Abel unto the blood of Zacharias son of Barachias, whom ye slew between the temple and the altar. Verily I say unto you, All these things shall come upon this generation. O Jerusalem, Jerusalem, thou that killest the prophets, and stonest them which are sent unto thee, how often would I have gathered thy children together, even as a hen gathereth her chickens under her wings, and ye would not! Behold, your house is left unto you desolate. For I say unto you, Ye shall not see me henceforth, till ye shall say, Blessed is he that cometh in the name of the Lord."
Matthew 23:34-39, KJV
"Woe unto you! for ye build the sepulchres of the prophets, and your fathers killed them. Truly ye bear witness that ye allow the deeds of your fathers: for they indeed killed them, and ye build their sepulchres. Therefore also said the wisdom of God, I will send them prophets and apostles, and some of them they shall slay and persecute: That the blood of all the prophets, which was shed from the foundation of the world, may be required of this generation; From the blood of Abel unto the blood of Zacharias, which perished between the altar and the temple: verily I say unto you, It shall be required of this generation."
Luke 11:47-51, KJV
"By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh."
Hebrews 11:4, KJV
"Not as Cain, who was of that wicked one, and slew his brother. And wherefore slew he him? Because his own works were evil, and his brother's righteous."
1 John 3:12, KJV