Matthew 7:24 Everyone then who hears these words of mine and does them will be like a wise man who built his house on the rock. 25 And the rain fell, and the floods came, and the winds blew and beat on that house, but it did not fall, because it had been founded on the rock. 26 And everyone who hears these words of mine and does not do them will be like a foolish man who built his house on the sand. 27 And the rain fell, and the floods came, and the winds blew and beat against that house, and it fell, and great was the fall of it. 
Over the last several years, I have asked people to identify the “rock” mentioned in this parable of Jesus at the end of the Sermon on the Mount. Almost without fail, people have admitted that they do not know, they are not sure, or, most commonly, they have answered that the “rock” is Jesus.
This last answer is easy to understand, since we are so familiar with such sayings as “Jesus is the Rock of my salvation.”
Jesus, the Rock
Interestingly, the New Testament never directly refers to Jesus as “the rock of our salvation.” With one exception, when the New Testament refers to Jesus as a stone or a rock, the reference is to a foundation stone – a stone that is purposefully cut or selected for erecting a building. 
Therefore, the reference to Jesus as a stone or rock does not directly relate to salvation, but to the church. We find this idea included in Jesus’ reply to Peter’s confession in Matthew 16:16, “You are the Christ, the Son of the living God.” Jesus replied in verse 18, “…upon this rock I will build my church.”
Paul expanded on this idea in his letter to the Ephesians when he explained that the church was “built on the foundation of the apostles and prophets, Christ Jesus himself being the cornerstone, in whom the whole structure, being joined together, grows into a holy temple in the Lord.” (Eph. 2:19-21)
We find the one exception to the use of the term “rock” in reference to Jesus in Paul’s letter to the church at Corinth.
During the sojourn of Israel to the Promised Land following the Exodus, God miraculously provided water from rock for the people to drink. (Ex. 17:6; Num. 20:11)  In the Hebrew, the word rock might refer to a large rock or boulder, but typically referred to a cliff or a wall of rock, like the side of a mountain.
Paul wrote that this Rock was Jesus (1 Cor. 10:4). Since the water did not set the Israelites free, then the rock does not represent salvation, but sustenance. It represents, not the saving grace of God, but His sustaining and His securing grace – His ability and willingness to keep that which belongs to him and provide for their every need.
The Old Testament, on the other hand, makes several references to God the Father as the Rock of salvation. 
2 Sam. 22:47 The LORD lives, and blessed be my rock, and exalted be my God, the rock of my salvation.
Since we know that Jesus is God, and since we know that what is true of God the Father is also true of God the Son, then we are correct in identifying Jesus as that same Rock of our salvation. Just note that it comes from the Old Testament, not the New.
The Rock of Matthew 7
With that review in mind, let’s go back to Matthew 7 and ask the question again. When Jesus refers to the rock in Matthew 7 (and again in Luke 6) to whom or what is He making reference?
To answer this question correctly requires that we pay very close attention to the context.
In chapters 5-7 of his gospel, Matthew records Jesus’ Sermon on the Mount. In this, His longest recorded sermon, Jesus explains and illustrates the character of those who are part of the kingdom. He does not prescribe what a Christian ought to try to become, but describing what a Christian will become through the process of sanctification. However, He qualifies His description at the end of the sermon.
In verses 15-20 of Matthew 7, Jesus warns of false prophets whom the people may readily identify by their fruits. Jesus does not refer to their profession, but to that which is visible – to “the practical effect of their teaching.” According to the commentary of The Didache, “by their fruits” means “by their behavior.” 
According to Adam Clarke, “Fruits, in the Scripture and Jewish phraseology, are taken for works of any kind.” They are “the confession of his own heart.” 
In verse 21, Jesus makes a very powerful statement:
Matt. 7:21 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but the one who does the will of my Father who is in heaven. 22 On that day many will say to me, ‘Lord, Lord, did we not prophesy in your name, and cast out demons in your name, and do many mighty works in your name?’ 23 And then will I declare to them, ‘I never knew you; depart from me, you workers of lawlessness.’”
If this reference proves nothing else, it proves that a profession of faith is not enough to prove that a person is a Christian. I once had a church member express quite angrily, “If a man says he’s a Christian, that is all that is required. I have no right to question him.”
Yet nothing could be farther from the truth.
On the Day of Judgment, there will be people who have convinced themselves of their own salvation who will find themselves in the grips of hell because all they had was a profession of faith with nothing to support their claim other than their own words.
That’s not only scary…It’s terribly sad!
In addition, these were not idle church members in verse 22, satisfied with sitting on the sidelines. They were engaged in ministry and good works. This proves that works alone are not enough to prove one’s salvation. The works must be in accordance with the will of God.
This makes what Jesus has to say in the next four verses of Matthew 7 so critical.
When Jesus used the word “rock,” to whom or to what is He referring?
To be continued…
 There are many such references in the New Testament. They are all quotes, paraphrases, or references to Psalm 118:22, Isaiah 8:14, and Isaiah 28:16. In the NT, see Matt. 21:42-44, Mark 12:10, Luke 20:17, Acts 4:11, Rom. 9:33, 1 Pet. 2:4-8. Even the stone in Daniel that “was cut out without hands,” an obvious prophetic reference to the Messiah, became the foundation stone for “a great mountain” that “filled the whole earth.” (Dan. 2:34-35, 45)
 Interestingly, in Psalm 114:8, the psalmist says that God did not just cause water to flow out of a rock, but that He actually converted the rock into water. This is a great picture of what happens in conversion.
 Deut. 32:15; 2 Sam. 22:3,47; Psalm 18:2, 46; 62:2,6,7; 89:26; 95:1; Isaiah 17:10
 Adam Clarke’s Commentary, quoted in the Online Bible.