We present a new contour segmentation method for femoral head detection in CT images. The principal idea underlying our approach is to represent the contour using active rays. Each ray has internal energy (continuity and smoothness constraints), as well as external energy (image-oriented edges and global a-priori knowledge). The causal nature of this representation allows a globally optimal, non-iterative solution to be found using dynamic programming. Moreover, even pathological bone structures can be automatically segmented. Several clinical situations on pelvis CT scan with hip degenerative change shows that this approach is more efficient than conventional methods. In this paper, we describe our method and discuss how it can be used to create graphical 3D models of the hip that are suitable for preoperative planning.