Does the Bible say we should pray to the dead? Is it okay or is it sin?
Prayer is essentially talking to God, but in a deeply reverential and respectful manner. It’s like a one on one conversation where we lay our prayer requests before God and trust Him to do whatsoever He wills. Praying in faith, we are not necessarily guarantying something will happen, but having faith in God Who works all things, good or bad, for our ultimate best (Rom 8:28). When someone said to me a few years ago, “God spoke to me about you and told me that you need to study prophecy,” I thought, “Hey, would God need an intermediator to try and tell me something?” If I wanted to talk to a friend, I wouldn’t call his friend and have him call my friend. The point is that God speaks to us in His written Word, the Bible. He may use others as a means to speak to us but we must use caution and discernment when it’s from others and then place it against Scripture. Praying  is vital because it’s our sole means of communication to our Creator God Who holds “all things possible” in His mighty, sovereign hands. You can trust Him with an unknown future because He’s been there and back. Read the ending (or beginning?) of the account (Rev 22).
When I say “Corporate Prayer,” I mean the collective prayers of the saints. This can be done in church, Bible study, Sunday school, at home through a prayer chain, or even at designated times. When the first century church heard that the apostles had been imprisoned and given lashes, they didn’t pray for it stop; rather, they prayed, “Lord, look upon their threats and grant to your servants to continue to speak your word with all boldness, while you stretch out your hand to heal, and signs and wonders are performed through the name of your holy servant Jesus” (Acts 4:29). Notice that they didn’t pray for better circumstances or to ask for the imprisonments and beatings to stop. They desired that God grant them “all boldness” so as to glorify the name of the “holy servant Jesus.” To the frustration of the persecutors, their persecution seemed to spread the gospel instead of stopping it. When the religious leaders told them to keep silent about Jesus, the Apostle Peter insisted, “Whether it is right in the sight of God to listen to you rather than to God, you must judge, for we cannot but speak of what we have seen and heard” (Acts 4:19-10). Were they lamenting their treatment? No! They “all were praising God for what had happened” (Acts 4:21b). We cannot underestimate the effectual prayers of many saints as with the primitive church and “when they had prayed, the place in which they were gathered together was shaken, and they were all filled with the Holy Spirit and continued to speak the word of God with boldness” (Acts 4:31).
Praying to the Father
In the so-called “Lord’s Prayer,” which is really a template or a specific order in which we pray, and we can see a great outline for us to use. The disciples never came up to Jesus to ask Him, “Lord, teach us how to heal, teach us how to multiply bread,” or even, “Lord, teach us how to preach” or “Walk on water.” The only recorded time that I have found where they asked Jesus to teach them something was when they saw “Jesus was praying in a certain place, and when he finished, one of his disciples said to him, “’Lord, teach us to pray, as John taught his disciples’” (Luke 11:1). They must have known and seen His prayer life and His intimate relationship with the Father and they wanted that. They had seen a similar prayer life in John’s disciples and in Jesus, more so. Jesus then gives them the starting point in saying, “Father, hallowed be your name. Your kingdom come” (Luke 11:2). Jesus gives no other option to Whom we must pray and that is the Father, through Jesus’ name (John 14:13-14; Matt 18:19) as He is our High Priest and Mediator (Heb 9:15; Heb 12:24).
Should we pray for the Dead?
The Bible never mentions praying for the dead but often, there are serious warnings about trying to communicate with the dead, realizing that praying for the dead is not praying to the dead. I understand that but the only verses that mention the dead are warnings to not communicate to them, as in Deuteronomy 18:10-11 “There shall not be found among you anyone who burns his son or his daughter as an offering, anyone who practices divination or tells fortunes or interprets omens, or a sorcerer or a charmer or a medium or a necromancer or one who inquires of the dead.” The prayers of the rich man  in hell shows that his families prayers are useless now as Abraham says he can’t go back to warn them because if the impassable gap between the “bosom of Abraham” and hades. The Bible teaches that right after death there is a judgment (Heb 9:27) and a person must be brought to repentance and faith in Christ before He returns or before they die. After that, like the rich man, you can’t come back. Neither can the prayers of every saint on earth save his soul now. That appointment is over!
I noticed in much of the New Testament church that they never prayed for the apostles to be freed from prison, they never prayed for the beatings to stop, and they never prayed to keep them from persecution. They simply prayed to have more boldness, but they never once prayed for someone that was dead, either in the Old Testament or the New Testament, therefore praying for the dead does nothing for the dead (Heb 9:27). Why not pray for the living that they might be saved?
Related reading for you: Can People Communicate with the Dead? 
Resource – Scripture quotations are from The Holy Bible, English Standard Version® (ESV®), copyright © 2001 by Crossway, a publishing ministry of Good News Publishers. Used by permission. All rights reserved.