ANSWER: The phrase you are referring to that seems to discuss a baptism for the dead is found in only one verse in the entire Bible. It is located in the book of 1Corinthians, chapter 15, and verse 29.
Mormons (The Church of Jesus Christ of Latter-day Saints) use 1Corinthians 15:29 to justify their teaching that a person who is alive can receive baptism for or on behalf of someone who is dead. After they perform this ritual, the spirit of the deceased person (according to the Mormons) can then either accept or reject the offered ordinance. This group has practiced this ceremony since 1840 A.D.
The Mormon Church's motives for promoting a vicarious baptism are not altogether bad. They want to believe those who never even heard about Jesus or those who heard but did not feel compelled to do much of anything about it can still be saved. The Bible does teach that the vast majority of humans will be ultimately saved, however, but only after they are brought back to a physical life in the second resurrection (Revelation 20:11).
Your question regarding 1Corinthians 15:29 is a good one. This Scripture has bewildered many people and has generated its share of controversy. Peter was aware of the difficulty in comprehending what Paul wrote when he said that some of his epistles contained "things hard to be understood" (2Peter 3:15 - 16). The misunderstanding can be cleared up, however, by understanding the context of Paul's statement and researching the Greek of what he is stating.
Else what shall they do which are baptized for (Greek: huper, Strong's Concordance #G5228) the dead . . . (1Corinthians 15:29, KJV)
The general context of the chapter concerns those in Corinth who were skeptical about the resurrection (verse 12). Because we cannot have eternal life without being resurrected first (Paul nor the Bible teaches an immortal soul), we need to be resurrected to be saved. Paul strongly implies in the chapter that he saw the resurrected Christ in a vision (verse 15 - see also Acts 9). He spends the entire chapter stating there is a future resurrection and describes what believers will look like in it. In verse 27, He states all things are put under the control of Jesus. Then in verse 28, he says Christ will subdue his enemies and put everything under God the Father.
Therefore, a rephrasing of Paul's statement would be something life, "Why be baptized for the hope of the dead, if you do not think they will be raised? Why did you receive baptism to begin with if those who die are not resurrected, since that is the only way to gain eternal life?" Verse 29 of 1Corinthians 15 is not stated very well in the King James Bible translation, but understanding its context does make it a bit clearer.
Written by Eric Snow
A BibleStudy.org Email Evangelist