What can emission lines tell us? page 1.1 Generalities 1.1.1 Line production mechanisms 1.1.2 The transfer of radiation 1.2 Empirical diagnostics based on emission lines 1.2.1 Electron temperature and density 1.2.2 Ionic and elemental abundances 1.2.3 Estimation of the effective temperature of the ionizing stars 1.2.4 Determining the star formation rate 1.2.5 How to distinguish normal galaxies from AGN hosts? 1.3 Photoionization modelling 1.3.1 Publicly available photoionization codes 1.3.2 Why do photoionization models? 1.3.3 How to proceed? 1.3.4 Abundance derivation by tailored model fitting 1.3.5 Abundance derivation using grids of models 1.3.6 Testing model atmospheres of massive stars using H ii regions 1.3.7 Photoionization study of an aspherical nebula using a 3D code: the planetary nebula NGC 7009 1.3.8 The interpretation of data from integral field spectroscopy 1.4 Pending questions iii Contents 1.4.1 Correction for reddening, underlying stellar absorption and aperture effects 1.4.2 Escape of ionizing radiation 1.4.3 The importance of stellar energy distribution 1.4.4 Dust 1.4.5 Temperature fluctuations and the ORL/CEL discrepancy 1.4.6 Shocks and related issues 1.5 Appendix: Lists of useful lines and how to deal with them References 1 What can emission lines tell us?Emission lines are observed almost everywhere in the Universe, from the Earth's atmosphere (see Wyse & Gilmore 1992 for a summary) to the most distant objects known (quasars and galaxies), on all scales, and at all wavelengths, from the radio domain (e.g. Lobanov 2005) to the gamma rays (e.g. Diehl et al. 2006). They provide very efficient tools to explore the Universe, measure the chemical composition of celestial bodies, and determine the physical conditions prevailing in the regions where they are emitted.The subject is extremely vast. In these lectures, we will restrict ourselves in wavelength, being mostly concerned with the optical domain, with some excursions to the infrared and ultraviolet domains and, occasionally, to the X-rays.We will mainly deal with the mechanisms of line production, and with the interpretation of line intensities in different astrophysical contexts. We will not discuss quasars and Seyfert galaxies, since those are the subject of the lectures by Brad Peterson, nor Lyman α galaxies, which are extensively covered by Daniel Schaerer in this book. However, we will discuss diagnostic diagrams used to distinguish active galaxies from other emission line galaxies, and will mention some topics linked with H Lyα. Most of our examples will be taken from recent literature on planetary nebulae, H ii regions and emission line galaxies. Emission line stars are briefly described in the lectures by Stephen Eikenberry in the same volume, and a more detailed presentation is given in the book "The Astrophysics of Emission Line Stars" by Kogure & Leung (2007).The vast subject of molecular emission lines has been left aside. The proceedings of the symposium "Astrochemistry: Recent Successes and Current Challenges" (Lis et al. 2006)...