The Bible strictly forbids praying to the dead in several places, including: Deuteronomy 18:11: States that anyone who "consults with the dead" is "detestable to the Lord" Leviticus 19:31: Prohibits the Israelites from interacting with "ghosts" and "departed spirits" for guidance or divination Isaiah 19:3: Condemns necromancy, or conjuring up the dead through mediums and wizards
Corinthians 10 20?  Paul commands his readers to flee from idol worship. To participate with idol worship in any way is to participate with demons. God always provides some way to avoid sin. So, they must avoid giving anyone the idea that they approve of idol worship, even by knowingly eating food offered to idols.