A musician will be able to give you a fuller answer, but basically: The melody is the tune, the melodic line, sung by a singer or played by a soloist. The music is the full musical score, including both the melodic line and the harmonies. The text is the words that are sung, the lyric or (in an opera) the libretto.