Aims. We present optical spectroscopy for a sample of BL Lac objects, to determine their redshift, to study their broad emission line properties, and to characterize their close environment. Methods. Twelve objects were observed using the ESO 3.6 m and NOT 2.5 m telescopes, obtaining spectra for the BL Lacs and for nearby sources.Results. For seven of these objects, nuclear emission lines and/or absorption lines from the host galaxy were detected. In all the four cases where absorption lines were revealed, the host galaxy has been resolved with HST or ground-based imaging. The broad H α luminosities (or their upper limits) of the BL Lacs are similar to those of radio-loud quasars. For two BL Lacs, spectroscopy of close companions indicates that they are at the redshift of the BL Lacs, and therefore physically associated and probably interacting. Five BL Lacs have a featureless spectrum. In these cases, we apply a new technique to derive lower limits for their redshift, which are consistent with the lower limits deduced from imaging.