Peter had laid a magnificent groundwork and here we see the response of those in the audience with good and honest hearts. It should be stressed that their reaction was based upon the inspired words of Peter--that is, what they "heard." Peter had told them they were guilty of crucifying the Messiah, Jesus the Christ, but that God had reversed their unjust death sentence by raising Jesus from the dead. Not only was Jesus alive, but He was ruling as the Lord and Christ at the Father's right hand! In other words, Jesus had all power and authority (cf. Matt. 28:18). These truths pierced the hearts of many who were present and caused deep grief and anguish. Peter had penetrated their hearts by using "the sword of the Spirit, which is the word of God" (Eph. 6:17).
As a consequence of their sorrow, they asked Peter and the other apostles (which implies all twelve are still involved in the speaking) a very important question - "What shall we do?" The fact that they asked this implies two things: (1) they believed the inspired words Peter spoke about the Christ, and (2) they had a self-awareness of their guilt. Was there anything they could do to correct their mistake? Was there anything they could do to be forgiven?
Before we consider Peter's reply to their question, it would be expedient to emphasize a great truth that is revealed here. This verse answers the question many have asked today: "How does the Holy Spirit work on the minds of people to influence their behavior?" Many in the religious world teach that the Holy Spirit works directly on the mind of an individual, without using any instrument or agent. This conviction is often expressed by people who affirm that the Holy Spirit led them--in a direct manner--to do or say a certain thing. Similarly, there are those who believe that man is so totally sinful that it is not even possible for him to develop faith unless the Holy Spirit first directly works on the individual's mind.
But friends, does the Bible teach these things? I do not believe that it does. Let me be clear in affirming that the issue is not whether or not the Holy Spirit guides, leads, and produces faith in people, rather the issue is how the Holy Spirit accomplishes those things. There is no doubt that the Holy Spirit does guide and lead people to Jesus (cf. Rom. 8:14; Gal. 5:18). The Holy Spirit does produce faith in people (as we have seen here in Acts 2). But the question is: How does He accomplish these things? Is it by a direct or indirect means? The context of Acts 2 settles the issue without a shadow of a doubt. On that great day of Pentecost, the Holy Spirit was working miraculously (e.g., He was working through the apostles enabling them to speak the wonderful works of God in various languages). So, the Holy Spirit was definitely present, as the awesome sounds and sights of that occasion had proven. However, when did the people first express faith in Jesus and remorse for their wickedness? Was it when they heard the sound as of a rushing wind? Was it when they saw the divided tongues of fire? Although the Holy Spirit was visibly and audibly active in Acts 2:2,3, it was not until the Spirit spoke through the apostles via words that the people would then express remorse and faith! Peter had used words to give the inspired meaning of these events as the beginning of the fulfillment of Joel's prophecy. Peter had used words to teach that Jesus had been approved by God, killed by Israel, and then raised by the Father. Peter had used words to preach that Jesus had fulfilled prophecy concerning the Messiah. Peter had used words to show that Jesus was exalted and enthroned by the Father, as prophesied. And Peter would soon tell them, by using words, what they needed to do to be forgiven. Peter had declared in Acts 2:14 - "Heed my words," and Acts 2:37 indicates that when they "heard" Peter's words they wanted to heed, but they needed to know how.
Isn't the evidence overwhelming? The Holy Spirit, through the words He directed Peter to speak, influenced the people to change their minds, led them to Jesus as the Christ, and created faith in their hearts! Even though the Spirit had miraculous manifestations that day, He did not work directly upon the hearts and minds of the people! He certainly had the power to do so, but that's not the question. He used His agent (Peter and the other apostles) and His instrument (the word of God) to guide, lead, and create faith in those people. The rest of the New Testament bears out this conclusion and shows that the Spirit always works in this indirect fashion upon the hearts and minds of men (even today).