Fecal shedding is an important mechanism of spreading of a number of human and animal pathogens. Understanding of the dynamics of pathogen fecal shedding is critical to be able to control or prevent the spread of diseases caused by these pathogens. The objective of this study was to develop a model for analysis of the dynamics of pathogen fecal shedding. Fecal shedding of Listeria monocytogenes in dairy cattle was used as a model system. A Markov chain model (MCM) with two states, shedding and non-shedding, has been developed for overall L. monocytogenes fecal shedding (all L. monocytogenes subtypes) and fecal shedding of three L. monocytogenes subtypes (ribotypes 1058A, 1039E and 1042B) using data from one study farm. The matrices of conditional probabilities of transition between shedding and non-shedding states for different sets of covariates have been estimated by application of logistic regression. The covariate-specific matrices of conditional probabilities, describing the presence of different risk factors, were used to estimate (i) the stationary prevalence of dairy cows that shed any L. monocytogenes subtype or ribotypes 1058A, 1039E, and 1042B, (ii) the duration of overall and subtype specific fecal shedding, and (iii) the duration of periods without shedding. A non-homogeneous MCM was constructed to study how the prevalence of fecal shedders changes over time. The model was validated with data from the study farm and published literature. The results of our modeling work indicated that (i) the prevalence of L. monocytogenes fecal shedders varies over time and can be higher than 90%, (ii) L. monocytogenes subtypes exhibit different dynamics of fecal shedding, (iii) the dynamics of L. monocytogenes fecal shedding are highly associated with contamination of silage (fermented feed) and cows' exposure to stress, and (iv) the developed approach can be readily used to study the dynamics of fecal shedding in other pathogen-host-environment systems.