Exodus 17, 3-7
But tormented by thirst, the people complained to Moses. 'Why did you bring us out of Egypt,' they said, 'only to make us, our children and our livestock, die of thirst?'
Moses appealed to Yahweh for help. 'How am I to deal with this people?' he said. 'Any moment now they will stone me!'
Yahweh then said to Moses, 'Go on ahead of the people, taking some of the elders of Israel with you; in your hand take the staff with which you struck the River, and go.
I shall be waiting for you there on the rock (at Horeb). Strike the rock, and water will come out for the people to drink.' This was what Moses did, with the elders of Israel looking on.
He gave the place the names Massah and Meribah because of the Israelites' contentiousness and because they put Yahweh to the test by saying, 'Is Yahweh with us, or not?'