The preposition "along" is used to describe movement or direction parallel to the edge of something, such as a river.
The correct sentence should be:
"He walked along the bank of the river."
Thus, the correct answer is Option B ("along").