A medical system and method for treating a disorder of a subject by thermal ablation, e.g., focused ultrasound thermal ablation, are provided. The method includes obtaining medical images that include at least one image of subject's chest and ribs to reconstruct a three-dimensional chest-rib distribution; and applying ultrasound waves on a target point beyond the subject's ribs by selectively activating one or more elements of an ultrasound phased array to avoid ultrasonic energy absorption or reflection by an intervening rib based on a calculation of a relationship between the three-dimensional chest-rib distribution and an acoustic emission direction.