A generalized pairing theory of superconductivity in layered crystals is formulated in terms of an arbitrary dynamical interaction, V( r1r2; t1- t2), among the electrons. This has been done within the framework of the Gorkov mean field theory, with the introduction of an appropriate set of states to represent the single particle motion in the layered crystals. The layer representation is band-like in the plane of the layers and localized in the perpendicular direction. This enables us to derive the equation for the superconducting state which includes intra-and inter-layer polarization interactions involving exchange of all possible electronic and ionic excitations in the system within the strong coupling formalism. An equation for the critical temperature Tc of the system has been obtained by solving the linearized gap equation in terms of a suitably averaged dynamical interaction. We specify from first principles the various approximations required to obtain the simpler forms of the Tc-equation used in the literature for investigating its dependence on the structure and number of conducting layers in the new high- Tc systems. In general, we find that the dynamical interactions can involve a maximum of any four different layers with intra- and inter-layer pairings. In the extreme layer approximation, where the excitations are highly localized to within individual layers, the interaction connects only a maximum of any two layers. These considerations still imply that the required attractive interaction for intra-layer Cooper pairing in a conducting layer may arise from both intra- and inter-layer couplings and possible exchange of excitations in the neighboring layers whether conducting or insulating.