I've read that Sauron was a Maia, one of the spirits that rank below the Valar in terms of power. He was initially a shapeshifter. In the beginning he assumed a beautiful form, later he took the form of a werewolf, serpent, vampire. Finally he was locked into one body - a humanoid “Dark Lord” form. Eventually he was not able to maintain a physical form at all because he was severely weakened by the loss of the ring.