Yes, the pain most probably comes from tensing the hand and wrist. As dcstudio pointed out, this is a very common problem in this piece.
I just want to add a few practice tips. Assuming we are right, what's the best way of getting rid of your excess tension? I would say, start by playing only a few of these broken octaves at a time, trying to find a technique that will allow you to "shake them out" effortlessly with the help of forearm rotation (which, btw, is the arm movement you use when turning a screwdriver or a door knob). Don't focus on a "fixed" hand position, this could make you even more stiff. Try to keep the hand and wrist supple. Rest frequently, and if possible, try to get a professional to evaluate the technique you are using.
Once you can play one bar of broken octaves with a technique you believe in, it shouldn't be too hard adding more and more bars. Allow this procedure to take some time. Meanwhile, you can practice the right hand to perfection