Summary of Early Historic Events
In the beginning, when time itself didn't exist, Eru, the one god, created in what was known as the Timeless Halls, the Ainur, or the "Holy Ones". According to the Elvish tale known as the Ainulindalë (a chapter in The Silmarillion) , the Ainur's spirits predated the creation of Eä, "The World that Is." They came into Existence in the very beginning. The Ainur were with Eru, "the One," before anything else was made. In Ainulindalë, it is told that Eru commanded all the Ainur together to put voice to a great music, the creation of the world.
During the singing of the great music, a powerful Ainu, Melkor, began to sing in discord to what he was supposed to sing. Around where he sang, others were dismayed and stopped singing. But also, some changed their song to that of Melkor's. One famous of these Ainu, was Sauron.
Thus was Arda (earth) marred.

Of course the singing didn't actually create the world, it only created the vision of what the world would be.
After the singing of the vision, Eru brought the vision to being and put forth the vision into time and space, and sent forth the "Flame Imperishable", the tool of creation to the center of the world. Then Eru called forth those, who if they wished, would bring the full vision of Arda to being, by entering Eä on the one catch that they couldn't return to the Timeless Halls until the whole history of the World was complete.
The greater of the spirits who entered Ea are named the Valar, the Powers of the World, and they numbered 15. Among them was Melkor, and he would always try to bring down what the Valar had placed, or try to subject everything he could, to his will.
When the Valar did enter Eä, they were dismayed, for what was in the vision wasn't what they saw in Arda. Then they realized, that it was they who were to shape the world and prepare the world for the coming of the children of Eru, the elves and the men. The Valar did finally settle down in Valinor to begin their labors

Other spirits followed the Valar into Eä, and they were considerably less powerful than the Valar. They were named the Maiar, the Hands. When the fifteen Valar ventured into Existence and accepted wardship over the newborn World, the Maiar followed. Maia groups ordered themselves as vassals of the Valar. Serving the greater Ainur, the Maiar labored according to guidelines of their specific Vala masters. They set about shaping Arda as the Powers directed. The Maiar's role was, as always, to aid their lords in completing the scheme envisioned by the Eru.
Melkor, is no longer counted as one of the Valar. Melkor, during the Music of the Ainur, corrupted those around him. Of the Maiar he sudduced, Sauron is the most well known. Also, the Balrogs, are Maia spirits.
All this lead up to the reveiling of the Elves, and later the Men.