  We examine the behavior of charged pions in neutron-rich matter using
heavy-baryon chiral perturbation theory. This study is motivated by the
prospect that pions, or pion-like excitations, may be relevant in neutron-rich
matter encountered in core-collapse supernovae and neutron star mergers. We
find, as previously expected, that the $\pi^-$ mass increases with density and
precludes s-wave condensation at $n_B\lesssim n_{\text{sat}}$, where
$n_{\text{sat}} \simeq 0.16 \text{fm}^{-3}$ is the nuclear saturation density,
and the mass of the $\pi^+$ mode decreases with density. The uncertainty in
these predictions increases rapidly for $n_B \gtrsim n_{\text{sat}} $ because
low energy constants associated with the two-pion-two-nucleon operators in
chiral perturbation theory are poorly constrained. We find that these
uncertainties are especially large in symmetric nuclear matter and should be
included in the analysis of pion-nucleus interactions at low energy and pionic
atoms. In neutron-rich matter, accounting for the self-energy difference
between neutrons and protons related to the nuclear symmetry energy has several
effects. It alters the power counting of certain higher-order contributions to
the pion self-energy. Previously unimportant but attractive diagrams are
enhanced and result in a modest reduction of the pion masses. Furthermore, in
the low-wavelength limit, a collective mode with the quantum numbers of the
$\pi^+$ appears.
