"Now when the apostles who were at Jerusalem heard that Samaria had received the word of God, they sent Peter and John to them, who, when they had come down, prayed for them that they might receive the Holy Spirit. For as yet He had fallen upon none of them. They had only been baptized in the name of the Lord Jesus. Then they laid hands on them, and they received the Holy Spirit. And when Simon saw that through the laying on of the apostles' hands the Holy Spirit was given, he offered them money" (Acts 8:14-18).
News of Philip's successful evangelistic efforts in Samaria got back to Jerusalem and Peter and John were sent (by the other apostles) to Samaria for a very specific reason. They were sent that they might lay hands on some of the new Christians and impart spiritual gifts (or "the Holy Spirit"). How do I know this to be the case? Prior to their coming, the Spirit had not yet "fallen upon" any of them. This terminology, as also used in Acts 10:44 and 11:15, always has reference to the Holy Spirit being received in such a way as to enable the recipient to work miracles of some sort. The new converts had been baptized and were absolutely saved prior to Peter and John's arrival. They had received the non-miraculous indwelling of the Spirit ("the gift" that Acts 2:38 speaks of), but none had yet received the power to work miracles. Such a power was very important in the infancy of the church where the New Testament was not yet revealed in a written, objective format. At the very least, prophets were needed in each congregation initially. If Luke had wanted to communicate that the new converts had not received the Holy Spirit in any form whatsoever, he would not have used the strong qualifying phrase that he did at the end of 8:16 - "they had only been baptized." Such a phrase is unnecessary if they had not received the Spirit in any fashion, but the phrase is very necessary if Luke wants us to understand that the Samaritan Christians had, of course, received the non-miraculous indwelling promised to all believers and received at one's baptism (cf. 2:38).
It becomes clear, from Simon's reaction, that miraculous power of the Spirit was able to be transferred from the apostles to those upon whom they laid their hands. Indeed, the ability to transfer miraculous power to another person is one of "the signs of an apostle" (II Cor. 12:12; cf. Rom. 1:11). The question must be raised: Why didn't Philip simply lay his hands on the people after their conversion in order to give them spiritual gifts? The implied answer is that although he was able to work miracles himself, he was unable to transfer that ability to another person. He had received the ability from the apostles (cf. Acts 6:6-8), and so would some of these new converts. The fact that Peter and John made a journey of over 30 miles demands this conclusion. They would not make such a journey if it was not necessary. If Philip could have imparted miraculous gifts of the Spirit upon the Samaritans, he would have done so and the apostles would have remained in Jerusalem. As a side note, if the miraculous gifts were only transferred by the apostles, they would die out after the apostles and those upon whom they laid their hands perished. Such is consistent with what is taught elsewhere in the Scriptures (cf. I Cor. 13:8-10; Eph. 4:8-13; Zech. 13:2).