The subject would be "the ball." The subject in the sentence is the person, place, or thing. In this case the ball would be the subject because it's the most mentioned in the sentence, and also it's the first thing that comes into mind when your reading the sentence, the BALL hits a goal post and then the BALL bounced off.
Hope this helps!