From: Matthew 7:21-29
Doing the Will of God
(Jesus said to His disciples,)  "Not every one who says to Me, `Lord, Lord,' shall enter the Kingdom of Heaven, but he who does the will of My Father who is in Heaven.  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?'  And then I will declare to them, `I never knew you; depart from Me, you evildoers.'
Building on Rock
 "Every one then who hears these words of Mine and does them will be like a wise man who built his house upon the rock;  and the rain fell, and the floods came, and the winds blew and beat upon that house, but it did not fall, because it had been founded on the rock.  And every one who hears these words of mine and does not do them will be like a foolish man who built his house upon the sand;  and the rain fell, and the floods came, and winds blew and beat against that house, and it fell; and great was the fall of it."
 And when Jesus finished these sayings, the crowds were astonished at His teaching,  for He taught them as one who had authority, and not as their scribes.
21-23. To be genuine, prayer must be accompanied by a persevering effort to do God's will. Similarly, in order to do His will it is not enough to speak about the things of God: there must consistency between what one preaches--what one says--and what one does: "The Kingdom of God does not consist in talk but in power" (1 Corinthians 4:20); "Be doers of the word, and not hearers only, deceiving yourselves" (James 1:22).
Christians, "holding loyally to the Gospel, enriched by its resources, and joining forces with all who love and practice justice, have shouldered a weighty task on earth and they must render an account of it to Him who will judge all men on the last day. Not every one who says, `Lord, Lord' will enter the Kingdom of Heaven, but those who do the will of the Father, and who manfully put their hands to the work" (Vatican II, "Gaudium Et Spes", 93).
To enter the Kingdom of Heaven, to be holy, it is not enough, then, to speak eloquently about holiness. One has to practice what one preaches, to produce fruit which accords with one's words. Fray Luis de Leon puts it very graphically: "Notice that to be a good Christian it is not enough just to pray and fast and hear Mass; God must find you faithful, like another Job or Abraham, in times of tribulation" ("Guide for Sinners", Book 1, Part 2, Chapter 21).
Even if a person exercises an ecclesiastical ministry that does not assure his holiness; he needs to practice the virtues he preaches. Besides, we know from experience that any Christian (clerical, religious or lay) who does not strive to act in accordance with the demands of the faith he professes, begins to weaken in his faith and eventually parts company also with the teaching of the Church. Anyone who does not live in accordance with what he says, ends up saying things which are contrary to faith.
The authority with which Jesus speaks in these verses reveals Him as sovereign Judge of the living and the dead. No Old Testament prophet ever spoke with His authority.
22. "That day": a technical formula in biblical language meaning the day of the Judgment of the Lord or the Last Judgment.
23. This passage refers to the Judgment where Jesus will be the Judge. The sacred text uses a verb which means the public proclamation of a truth. Since in this case Jesus Christ is the Judge who makes the declaration, it takes the form of a judicial sentence.
24-27. These verses constitute the positive side of the previous passage. A person who tries to put Christ's teaching into practice, even if he experiences personal difficulties or lives during times of upheaval in the life of the Church or is surrounded by error, will stay firm in the faith, like the wise man who builds his house on rock.
Also, if we are to stay strong in times of difficulty, we need, when things are calm and peaceful, to accept little contradictions with a good grace, to be very refined in our relationship with God and with others, and to perform the duties of our state in life in a spirit of loyalty and abnegation. By acting in this way we are laying down a good foundation, maintaining the edifice of our spiritual life and repairing any cracks which make their appearance.
28-29. Jesus' listeners could clearly see the radical difference between the style of teaching of the scribes and Pharisees, and the conviction and confidence with which Jesus spoke. There is nothing tentative about His words; they leave no room for doubt.
Source: "The Navarre Bible: Text and Commentaries". Biblical text taken from the Revised Standard Version and New Vulgate. Commentaries made by members of the Faculty of Theology of the University of Navarre, Spain. Published by Four Courts Press, Kill Lane, Blackrock, Co. Dublin, Ireland. Reprinted with permission from Four Courts Press and Scepter Publishers, the U.S. publisher.