Bacterial lacZ is one of the most commonly used reporter genes for assessing gene transfer to lung. However, lung contains endogenous beta-galactosidase (beta-Gal), which can confound estimation of exogenous lacZ expression by histochemical techniques (i.e., X-Gal) for in situ demonstration of enzyme activity. We investigated several parameters of the X-Gal reaction, including time and temperature of X-Gal exposure as well as lung tissue processing and fixation techniques, and found that none of these could be used to distinguish between endogenous and exogenous beta-Gal activities. The mammalian and bacterial beta-Gal enzymes, however, have pH optima in the acidic and neutral ranges, respectively. Exposing whole lung, lung minces, or mounted frozen sections of lung to X-Gal at mildly alkaline pH (pH 8.0-8.5), minimized detection of endogenous activity in lungs from a variety of species while preserving that resulting from bacterial enzyme activity in a transgenic mouse expressing lacZ. This technique was also useful in distinguishing endogenous activity from that resulting from adenovirus-mediated lacZ gene transfer to diploid lung fibroblasts in primary culture. An appropriate buffer that maintains the desired pH throughout the duration of X-Gal exposure must be used.