A method and apparatus for correcting malformed joints, in particular the “hammer toe” contraction of the proximal interphalangeal joint. The disclosure comprises a two-component implant: a proximal phalanx component and a middle phalanx component. An endosseous stem on each component is inserted axially into the end of a respective host bone and, after insertion, the components are attached. The attached components are held together in various ways, for example a detent arm/aperture mechanism. Each component can be cannulated to allow for the passage of a kirschner wire, if necessary, to stabilize adjacent joints such as the proximal interphalangeal joint. The bones of the treated joint can be set to form a desired angle by adjusting the angle formed by the corresponding endosseous stems.