A prosthesis is provided for replacing a portion of a bone making up a joint. The prosthesis is adapted, intraoperatively, to optimize the anatomical alignment of the prosthesis in the joint. In particular, a jig is used to identify the axis of rotation of the joint intraoperatively and to align a portion of the prosthesis with the identified axis. The angle of the head of the prosthesis is adjusted to optimize contact with the appropriate corresponding portions of the joint, at which point the position of the head is fixed to prevent further rotation of the head relative to the remainder of the prosthesis.