Psalms 106:28

They joined themselves also unto Baal-peor, and ate the sacrifices of the dead.

The verse points to Israel's encampment in Shittim, near Beth-peor, where the worship of Baal was a degrading idolatry joined to licentiousness. The ease of the surroundings and constant exposure to corrupt practices polluted their thoughts and drew them gradually away from God until they were left open to temptation. To join themselves to Baal-peor was to enter into its worship, and the sacrifices of the dead were sacrifices offered to the dead, so that the worship at Baal-peor is set forth as worship of the dead. By that joining and eating Israel provoked God, bringing a plague that was stayed only when Phinehas executed judgment, and his act was counted to him as righteousness unto all generations.

The verse stands as a biblical condemnation and example of the ancient forbidden practices connected with supposed communication with the dead. The spirits manifest in such supposed communion are demons, not the departed dead. As part of Israel's wilderness history of idolatry and downfall, the verse serves as a warning for God's people in the last days. That history is to be studied regularly and taken heed to lest they fall, avoiding the same sins, unbelief, rebellion, evil desire, and idolatry.