An approach is presented for developing optimal strategies for distance road racing and cross-country racing, i.e., running, skiing, and bicycling over courses of varying terrain. The course can be divided into segments defined by known properties, and the racer may be characterized by his abilities relative to the course segments and total energy available for completing the course. Functional optimization methods are used to select the racer's velocity in each segment to minimize the total time required to complete the course without exceeding any of the racer's limits. Two characterizations of the racer's total capability concerning course parameters are developed. Using a “distance-life” model based on data, examples of optimal strategies over courses of varying terrain are presented. It is shown that the defined optimal strategy is measurably better than other strategies. Several new concepts are introduced that are easily adapted to such problems and can be used in developing fundamental energy expenditure relations.