He turned the sea into dry land; they went through the river on foot
This refers to the crossing of the Red Sea.
they went
The word "they" refers to God's people, the Israelites.
we rejoiced
The word "we" refers to the Israelites, their ancestors, David, and the people he is speaking to.