A proposal is put forward to use Bayesian networks to identify risk factors for pulmonary consolidation. An experiment was conducted with 410 fattening lambs from five feedlots in Extremadura (southwestern Spain). Environmental conditions (temperature, relative humidity, and ammonia concentration) were recorded during the study period. In a microbiological study, Mycoplasma spp. and Pasteurellaceae were obtained by conventional culture and identified by nested polymerase chain reaction. After slaughter, lungs were collected and examined macro- and microscopically (histological type and pulmonary consolidation). To the best of the authors’ knowledge, Bayesian networks have not before been used to relate the presence/absence of pulmonary consolidation to environmental conditions, Mycoplasma spp., Pasteurella spp., and histological changes. The results showed that the main factors causing ovine inflammatory respiratory processes and pulmonary consolidation were temperature, relative humidity, and Mycoplasma spp. Control of these factors may help reduce the incidence of pulmonary consolidation.