A message from God
In the New International Version of the Bible, the word "dream" appears 70 times, of which 63 times in the Old Testament and only 7 times in the New Testament.
Dreams are belived to be from God, a way of communication between divinity and mankind. An angel appears to Joseph in a dream to let him know that Mary has conceived from the Holy Spirit. The three magi from the East that came to worship the new born king are warned in a dream not to go back to Herod. Joseph is told in a dream to take Mary and baby Jesus to Egypt, then, after Herod's death, to return into the country. Pilate's wife has an unsettling dream before Jesus' trial.
The Old Testament abounds in dreams, as they seem to be one of God's favourite ways of communicating with people. The classical example is probably Joseph, whose prophetic dreams first get him into trouble with his brothers, then rescue him from pharaon's prison, saving in the end the whole nation of Israel from famine and poverty. The prophet Daniel interpretes king Nebuchadnezzar's dream and his interpretation proves to be true. The righteous Job is torn by horrendous nightmares. The Lord appears to king Solomon in a dream, offering to give him whatever he asks for.
The old prophecies about the end of the world mention that there will come a time when people will have visions and dreams: "In the last days, God says, I will pour out my Spirit on all people. Your sons and daughters will prophesy, your young men will see visions, your old men will dream dreams." (Joel 2:28, quoted in Acts 2:17). However, not all dreams are reliable. Jeremiah warns the nation against the false prophets who claim their dream is from God.