The scientific study of dreams is called oneirology. Scientists believe that, in addition to humans, birds and other mammals also dream.
Hippocrates (469-399 BC) had a simple dream theory: during the day, the soul receives images; during the night, it produces images. Greek philosopher, Aristotle (384-322 BC) believed dreams caused physiological activity. He thought dreams could analyze illness and predict diseases. Marcus Tullius Cicero, for his part, believed that all dreams are produced by thoughts and conversations a dreamer had during the preceding days.
People have proposed many hypotheses about the functions of dreaming. Sigmund Freud (pictured on the right) postulated that dreams are the symbolic expression of frustrated desires that have been relegated to the unconscious mind, and he used dream interpretation in the form of psychoanalysis to uncover these desires. In The Interpretation of Dreams, Freud developed a psychological technique to interpret dreams and devised a series of guidelines to understand the symbols and motifs that appear in our dreams. Here is a link to a great site on dream interpretations, Dream Moods.
Certain processes in the cerebral cortex have been studied by John Allan Hobson and Robert McCarley. In their activation synthesis theory, for example, they propose that dreams are caused by the random firing of neurons in the cerebral cortex during the REM period. Neatly, this theory helps explain the irrationality of the mind during REM periods, as, according to this theory, the forebrain then creates a story in an attempt to reconcile and make sense of the nonsensical sensory information presented to it. Ergo, the odd nature of many dreams.
There are many other hypotheses about the function of dreams, including: