Psalm 106:28-30:

They joined themselves also unto Baal-peor, and ate the sacrifices of the dead.
Thus they provoked him to anger with their inventions: and the plague brake in upon them.
Then stood up Phinehas, and executed judgment: and so the plague was stayed.

Notes on Psalm 106:28-30:

God’s view of plagues is much different from ours.  We would be likely to say, “Oh well, it’s flu season!  That’s what the TV ads keep telling us.”  Here a plague was a curse for rebellion, and a righteous act made atonement and stopped the plague.  The fact that your sins have been atoned for by Jesus Christ puts you on the right side of this verse (the plague was stayed after an atonement was made), rather than the wrong side (rebellion brought a plague).

These verses are related to an incident in the book of Numbers.  The entire story is found there.

See also:

Numbers 25:3-13