Then Jesus was led up by the Spirit into the wilderness to be tempted by the devil. 2He fasted for forty days and forty nights, and afterwards he was famished. 3The tempter came and said to him, ‘If you are the Son of God, command these stones to become loaves of bread.’ 4But he answered, ‘It is written,
“One does not live by bread alone,
but by every word that comes from the mouth of God.” ’
5 Then the devil took him to the holy city and placed him on the pinnacle of the temple, 6saying to him, ‘If you are the Son of God, throw yourself down; for it is written,
“He will command his angels concerning you”,
and “On their hands they will bear you up,
so that you will not dash your foot against a stone.” ’
7Jesus said to him, ‘Again it is written, “Do not put the Lord your God to the test.” ’
8 Again, the devil took him to a very high mountain and showed him all the kingdoms of the world and their splendour; 9and he said to him, ‘All these I will give you, if you will fall down and worship me.’ 10Jesus said to him, ‘Away with you, Satan! for it is written,
“Worship the Lord your God,
and serve only him.” ’
11Then the devil left him, and suddenly angels came and waited on him.
Translation: Then Jesus was taken up by the Spirit into the wilderness to be tempted by the devil. And he fasted forty days and forty nights. Afterwards, he was hungry. And the tempter came (and) said to him, "If you are son of God, speak that these stones might become loaves of bread." But he answered (and) said, "It has been written: The human being will not live on bread alone, but upon all words going out through a mouth of God.'"
Then the devil takes him into the holy city and stood him upon the pinnacle of the temple, and he said to him, "If you are son of God, throw yourself down, for it has been written: 'He will give his angels command around you' and "Upon the hand he will take you up, when you might not stumble your foot to a stone.' Jesus was saying to him, "Again it has been written: 'You will not tempt the Lord your God'"
Again the devil takes him into an exceedingly high mountain and he shows him all the kingdoms of the cosmos, and their glory, and he said to him, "All these things I will give to you, if you might fall down and worship me." Then Jesus said to him, "Go away Satan, for it has been written, 'You will worship your God, and you will serve only him.'"
Then the devil releases him, and behold! angels came and were serving him.
Background and situation: The primary source is Mark (1: 12-13), sort of. The text begins and ends in Mark, with Q material in between.
Matthew seems to soften Mark's rather chaotic temptation episode. In Mark, the Spirit drove Jesus into the wilderness. Matthew, however, has the Spirit "take Jesus up" into the wilderness. In Matthew, Jesus appears fully in control throughout. He fasts for forty days and only afterward is he hungry. Unlike Mark, Matthew has no "wild beasts" with Jesus.
After that, the source is Q, and the proper parallel would be Luke 4: 1-13. Matthew differs from Luke in that where Luke has "forty days," Matthew has "forty days and forty nights."
Matthew makes two connections with Israel here. First, the number 40 recalls the travails of the children of Israel who wandered in the wilderness for 40 years. Second, the phrase "forty days and forty nights" recalls Moses (Ex 34:28) who had been on Mt. Sinai for "forty days and forty nights." As he does throughout the book, Matthew presents Jesus as "like Moses, but even beyond Moses."