We report on results of our theoretical study of the c-axis infrared conductivity of bilayer high-Tc cuprate superconductors using a microscopic model involving the bilayer-split (bonding and antibonding) bands. An emphasis is on the gauge-invariance of the theory, which turns out to be essential for the physical understanding of the electrodynamics of these compounds. The description of the optical response involves local (intra-bilayer and inter-bilayer) current densities and local conductivities. The local conductivities are obtained using a microscopic theory, where the quasiparticles of the two bands are coupled to spin fluctuations. The coupling leads to superconductivity and is described at the level of generalized Eliashberg theory. Also addressed is the simpler case of quasiparticles coupled by a separable and nonretarded interaction. The gauge invariance of the theory is achieved by including a suitable class of vertex corrections. The resulting response of the model is studied in detail and an interpretation of two superconductivity-induced peaks in the experimental data of the real part of the c-axis conductivity is proposed. The peak around 400/cm is attributed to a collective mode of the intra-bilayer regions, that is an analogue of the Bogolyubov-Anderson mode playing a crucial role in the theory of the longitudinal response of superconductors. For small values of the bilayer splitting, its nature is similar to that of the transverse plasmon of the phenomenological Josephson superlattice model. The peak around 1000/cm is interpreted as a pair breaking-feature that is related to the electronic coupling through the spacing layers separating the bilayers.