We introduce the notion of contactly geodesic transformation of the metric of an almost-contact metric structure as a contact analog of holomorphically geodesic transformations of the metric of an almost-Hermitian structure. A series of invariants of such transformations is obtained. We prove that such transformations preserve the normality property of an almost-contact metric structure. We prove that cosymplectic and Sasakian manifolds, as well as Kenmotsu manifolds, do not admit nontrivial contactly geodesic transformations of the metric, which is a contact analog of the well-known result for Kählerian manifolds due to Westlake and Yano.