  The tunability of topological surface states (SS) and controllable opening of
the Dirac gap are of fundamental and practical interest in the field of
topological materials. In topological crystalline insulators (TCIs), a
spontaneously generated Dirac gap was recently observed, which was ascribed to
broken cubic crystal symmetry. However, this structural distortion has not been
directly observed so far, and the microscopic mechanism of Dirac gap opening
via crystal symmetry breaking remains elusive. In this work, we present
scanning tunneling microscopy (STM) measurements of a TCI Pb$_{1-x}$Sn$_x$Se
for a wide range of alloy compositions spanning the topological and
non-topological regimes. STM topographies directly reveal a symmetry-breaking
distortion on the surface, which imparts mass to the otherwise massless Dirac
electrons - a mechanism analogous to the long sought-after Higgs mechanism in
particle physics. Remarkably, our measurements show that the Dirac gap scales
with alloy composition, while the magnitude of the distortion remains nearly
constant. Based on theoretical calculations, we find the Dirac mass is
controlled by the composition-dependent SS penetration depth, which determines
the weight of SS in the distorted region that is confined to the surface.
Finally, we discover the existence of SS in the non-topological regime, which
have the characteristics of gapped, double-branched Dirac fermions.
