<i>Cordyceps militaris</i> is a medicinal and edible mushroom. Researchers often add exogenous substances to the culture medium to increase the active substance content in <i>C. militaris</i>. However, the effect of earth elements on the active substance content in <i>C. militaris</i> and its antioxidant effects have not been reported. In this study, the active substance content in <i>C. militaris</i> treated with lanthanum nitrate was determined using high-performance liquid chromatography and ultraviolet spectrophotometry, and the effect on the antioxidant capacity of <i>C. militaris</i> after lanthanum nitrate spraying was further explored. The results showed that, in the experimental concentration range, the two concentrations of 10 mg/L and 50 mg/L had a significant influence on the active substance content of <i>C. militaris</i>. When the concentration of lanthanum nitrate was 10 mg/L, the synthesis of pentostatin and cordycepin was promoted. When the concentration of lanthanum nitrate was 50 mg/L, it significantly promoted the synthesis of cordycepin, and the ferric-reducing power and DPPH· scavenging rate of <i>C. militaris</i> treated at this concentration were significantly higher than those of the control group. However, lanthanum nitrate had no significant effect on ergosterol synthesis (<i>P</i> > 0.05). Finally, considering that the residual amount of lanthanum in <i>C. militaris</i> and the residual amount of lanthanum in 50 mg/L lanthanum nitrate-treated <i>C. militaris</i> is within the allowable daily intake of 4.2 mg for humans, the optimal concentration of lanthanum nitrate-treated <i>C. militaris</i> is 50 mg/L.