Necrotizing enterocolitis (NEC) is the most common gastrointestinal emergency of premature infants, but its etiology remains unclear. We have previously shown that mucin 2 (Muc2) positive goblet cells are significantly decreased in NEC. We have also shown that ileal bile acids (BAs) are significantly increased during the development of this disease. Because BAs can affect mucins, we hypothesized that elevated ileal BAs contribute to decreased Muc2 in experimental NEC. The role of Muc2 in NEC was evaluated in Winnie +/+ mice, a strain that produces aberrant Muc2. Muc2 and trefoil factor 3 (Tff3) were assessed in neonatal rats subjected to the NEC protocol when bile acids were removed, and in ileal explants from newborn and older rats cultured with and without BAs. Further, the role of active transport of BAs was determined using neonatal rats given the apical sodium dependent bile acid transporter (Asbt) inhibitor SC-435 and in neonatal Asbt knockout mice subjected to the NEC protocol. Mice with aberrant Muc2 had significantly greater incidence and severity of NEC. Using both in vivo and ex vivo techniques, we determined that BAs decrease Muc2 positive cells in neonatal but not older ileum. However, Tff3 positive cells are not decreased by BAs. In addition, active transport of BAs is required for BAs to decrease Muc2 in immature ileum. These data show that functional Muc2 plays a critical role in the prevention of NEC and BAs can potentiate the decreased Muc2 in disease development. Further, BAs have a more profound effect on Muc2 in immature versus older ileum, which may explain at least in part why NEC occurs almost exclusively in premature infants.