For some reason, God gets mad at Israel, and provokes David to do something wrong: conduct a census.
When David gives the order, Joab is skeptical and asks him why he wants to do this.
David wins the argument, and Joab leads the census team through the whole land, returning in a nine months and twenty days.
Turns out, says Joab, that there are eight hundred thousand men fit to be soldiers in Israel and five hundred thousand in Judah.
From God to Gad
Yet, David suddenly realizes that what he did was wrong. He apologizes to God, and waits for God to send news in return.
God sends a message through a prophet named Gad: David can have three years of famine, three months of running from his enemies, or three days of pestilence.
David says he would prefer to fall into the hands of the Lord than into human hands.
So, God sends three days of pestilence to Israel, killing seventy thousand people.
Freaked Out by an Angel
Yet, while standing on the threshing floor or Aruanah the Jebusite, David sees this angel of pestilence. He suddenly feels horrible about all the people dying, and he says that it is him—David—alone who has sinned. He asks for the penalty to fall on his house.
God tells Gad to tell David to build an altar on the threshing floor to end the pestilence.
So David goes to build an altar on the threshing floor, offering to buy it from Araunah. Araunah thinks this is a good idea, and offers oxen to sacrifice, and wood for burning, as well.
But David insists on paying Araunah, because he doesn't want to give God cheap-o offerings.
The sacrifices go off without a hitch, and God ends the plague on Israel. Finis.