"Now it came to pass, when the time had come for Him to be received up, that He steadfastly set His face to go to Jerusalem, and sent messengers before His face. And as they went, then entered a village of the Samaritans, to prepare for Him. But they did not receive Him, because His face was set for the journey to Jerusalem. And when His disciples James and John saw this, they said, 'Lord, do You want us to command fire to come down from heaven and consume them, just as Elijah did?' But He turned and rebuked them, and said, 'You do not know what manner of spirit you are of. For the Son of Man did not come to destroy men's lives but to save them.' And they went to another village" (Luke 9:51-56).
Admittedly, this passage from Luke is difficult to place chronologically, but it seems likely to be a description of Jesus' journey to Jerusalem for the Feast of Tabernacles. From John 7:10, we learn that Jesus left at a later time than His family did to travel to Jerusalem for this feast. He arrived during the middle of the feast (cf. 7:14), but this was done so that He would not draw attention to Himself since the people would then be preoccupied with the activities of the feast. His desire at this time was to enter the city quietly and without fanfare.
"When the time had come for Him to be received up...He steadfastly set His face to go to Jerusalem" (Luke 9:51). In its strictest sense, the phrase "received up" must refer to Jesus' ascension into heaven, but since that event was still approximately six months into the future, it should be understood as representing all of the events associated with His ascension. Surely Jesus does not desire to go to Jerusalem to endure excruciating suffering, but He knows that it is for the best. Thus, He resolves to go to continue fulfilling the Father's will, ultimately to be received back into heaven.
It seems reasonable to suggest that His apostles were the messengers sent. Why they needed to be sent ahead to "prepare for Him" is unknown, especially since Jesus wasn't treated well when He arrived.
The Samaritans "did not receive" Jesus because they knew He was intent upon going to Jerusalem. In the past, they did receive Him (e.g., John 4:40), and had He come to them on a missionary tour at this time they probably would have received Him again. The fact that He came to them as a Jew who was merely passing through to Jerusalem and using their roads for convenience was probably what irritated them. Some scholars speculate that the Samaritans may have been offended by Jesus' heading to Jerusalem for it implied that their place of worship, Mount Gerizim, was not proper.
James and John then ask, regarding the Samaritans' poor treatment of Jesus - "Lord, do You want us to command fire to come down from heaven and consume them, just as Elijah did?" It is possible that the recent appearance of Elijah during the transfiguration reminded the sons of Zebedee of the incident recorded in II Kings 1:10-12.
Jesus' response was a powerful rebuke to their proposed solution - "You do not know what manner of spirit you are of." These two disciples were indignant at the rejection of Jesus, but this did not give them the right to take the lives of the Samaritans (cf. II Pet. 3:9). After all, had they done so, the dead could never have been converted to Christ, and it is unlikely that the rest of the Samaritans would have been receptive when Philip came to them and preached the gospel at a later time (cf. Acts 81024 :5ff). James and John had a spirit of violence and misguided zeal that wasn't compatible with their mission--that is, the saving of souls (cf. Luke 19:10). It seems likely that James and John earned their nickname from this incident (cf. Mark 3:17 - "Sons of Thunder").
Wise Christians today will always remember that their mission is to seek and save the lost--not to damage, destroy, or condemn a soul to eternal condemnation.