A theory of rays, or bicharacteristics, is presented within the relativistic framework for the matter scheme of anisotropic elasticity and its generalization to perfectly conducting magnetic bodies. The equation governing the evolution of the amplitude (growth or decay) of weak waves is obtained. This equation allows one to discuss the influence of purely relativistic effects and the effect of initial states germane to the physical description of interest, e.g. high hydrostatic pressure and intense magnetic fields of various settings, on the formation of caustics via the phenomenon of focusing, the resulting steepening of the wave front and the subsequent formation of shock waves. Analytic expressions are obtained for the values of the characteristic parameter corresponding to the breakdown of the weak-wave solution for plausibly simple elastic behaviours and various settings of the initial magnetic field. The relative influence, at both relativistic and non-relativistic orders, of the nonlinearity of the material, the initial pressure, and the direction of the magnetic field with respect to the wave-propagation direction and the elastic-disturbance polarization is thoroughly discussed, some effects favouring, others delaying, the formation of shocks. For magnetic bodies the present treatment simultaneously provides results that prove to be useful in the non-relativistic theory of magnetoelasticity in perfect conductors.