Acts 8:18-20

18 And when Simon saw that through laying on of the apostles' hands the Holy Ghost was given, he offered them money,
19 Saying, Give me also this power, that on whomsoever I lay hands, he may receive the Holy Ghost.
20 But Peter said unto him, Thy money perish*#stm5751 with thee, because thou hast thought that the gift of God may be purchased with money.

Acts 8:18-20 In-Context

16 (For as yet he was fallen upon none of them: only they were baptized in the name of the Lord Jesus.)
17 Then laid they their hands on them, and they received the Holy Ghost.
18 And when Simon saw that through laying on of the apostles' hands the Holy Ghost was given, he offered them money,
19 Saying, Give me also this power, that on whomsoever I lay hands, he may receive the Holy Ghost.
20 But Peter said unto him, Thy money perish with thee, because thou hast thought that the gift of God may be purchased with money.
21 Thou hast neither part nor lot in this matter: for thy heart is not right in the sight of God.
22 Repent therefore of this thy wickedness, and pray God, if perhaps the thought of thine heart may be forgiven thee.