If a boy is experiencing pain in his knees while playing basketball, you could say "The boy's knees are hurting while playing basketball." Alternatively, you could say "The boy is experiencing knee pain while playing basketball."