Are you referring to the story by Rudyard Kipling? In this story, three friends are celebrating New Year's Eve by drinking. They are British men living in India. One, Fleete, gets particularly drunk and defaces the statue of an Indian god, Hanuman the Monkey God, with his cigar butt. He states that he is giving the statue the "mark of the beast." Immediately a leper/priest jumps out from behind the statue and touches Fleete with his diseased body. Soon after, a mark appears on Fleete's chest. He begins acting strangely - he is ravenously hungry, his horse is afraid of him, he cannot bear light and he literally turns into a beast:
The human spirit must have been giving way all day and have died out with the twilight. We were dealing with a beast that had once been Fleete.
In the book of Revelation in the Bible, the apostle John warns us:
Here is wisdom. Let him that hath understanding count the number of the beast: for it is the number of a man; and his number is Six hundred threescore and six.
The number 666, therefore, refers to the Anti-Christ, who will one day come and wreak havoc on the earth. The Anti-Christ will be empowered by Satan. The number 666 and the reference to "the Beast" in literature is symbolic of evil, or Satan. Once one has received "the mark" one is doomed. So in this story, Fleete is doomed. Strickland, his friend, recognizes the spiritual nature of the danger to his friend, being familiar with the Biblical prophecy. When Fleete cries out, Strickland notes that if this happens six times, it will confirm the spiritual nature of the attack on Fleete:
'Watch!' said Strickland. 'If this happens six times I shall take the law into my own hands. I order you to help me.'
Fleete's friends then trap the leper/priest and force him to reverse the evil spell:
We unstrapped the leper and told him to take away the evil spirit. He crawled to the beast and laid his hand upon the left breast.
They perform an exorcism, driving out the evil.
The Bible says that when the Anti-Christ appears, he will require everyone to "receive the mark" and those who do not, will not be able to survive because they will not be able to buy food, water, etc. When Fleete's friends force the leper/priest to exorcise the evil spirit from their friend, they are acting in an opposite way to Jesus' words in John 10:14:
I am the good shepherd; I know my sheep and my sheep know me--
Since the Anti-Christ will do everything "anti" Christ, he will also pervert Christ's sayings. So while Jesus knows who his sheep are, so does Satan. That is why the evil leper/priest is the only one who can drive out the demon in Fleete.