Paul casts an evil spirit out of a woman. He and Silas are scourged and imprisoned.

Acts 16:16–24

16 And it came to pass, as we went to prayer, a certain damsel possessed with a spirit of divination met us, which brought her masters much gain by soothsaying:
17 The same followed Paul and us, and cried, saying, These men are the servants of the most high God, which shew unto us the way of salvation.
18 And this did she many days. But Paul, being grieved, turned and said to the spirit, I command thee in the name of Jesus Christ to come out of her. And he came out the same hour.
19 And when her masters saw that the hope of their gains was gone, they caught Paul and Silas, and drew them into the marketplace unto the rulers,
20 And brought them to the magistrates, saying, These men, being Jews, do exceedingly trouble our city,
21 And teach customs, which are not lawful for us to receive, neither to observe, being Romans.
22 And the multitude rose up together against them: and the magistrates rent off their clothes, and commanded to beat them.
23 And when they had laid many stripes upon them, they cast them into prison, charging the jailor to keep them safely:
24 Who, having received such a charge, thrust them into the inner prison, and made their feet fast in the stocks.

Elder Bruce R. McConkie wrote:

“The testimony of the devil-led damsel was true. Paul and Silas were prophets; they had the words and power of salvation. But true testimony from Satan’s servants does not lead to salvation. In effect the damsel was saying: ‘Go ahead and believe in Paul and Silas and this Jesus whom they preach. I agree they and their Master are of God; and since we are now united on that point, you can also continue to follow me and enjoy the fruits of my divination.’ And how many other practitioners of false religions there are who give lip service to Jesus and His doctrines so that people will the more readily follow them and their special brand of ‘saving’ grace. It was for the very reason here involved that Jesus Himself forbade the devils whom He cast out to testify that He was the Son of God [see Luke 4:41]. . . .

“. . . When the devil departed from the damsel she no longer could divine the future, a change immediately evident to her masters whose source of income thereby ended. . . .

“. . . Two Romans [Paul and Silas], citizens of the mightiest empire on earth—entitled thereby to an impartial trial; to an appeal to the emperor; to freedom from degrading punishments, including bonds, scourging, and crucifixion—are here condemned without a trial, scourged without mercy, imprisoned in bonds in a damp and pestilential cell, all for the testimony of Jesus and the hope of a better resurrection.”

(Doctrinal New Testament Commentary, 3 vols. [1965–73], 2:149, 151.)