It is found experimentally that the exchange coupling J between ferromagnetic layers separated by nonmagnetic transition or noble metal spacers oscillates as a function of the spacer thickness D. For noble metal spacers RKKY theory is applicable but it must be modified to take account of discreteness of the spacer layer. It is shown that Bragg scattering in the spacer is crucial for explaining the observed long oscillation periods. The coupling through a transition metal is attributed to the spatial confinement of holes in the d band leading to size quantization of their energy. An anology with the dHvA effect is exploited to derive an RKKY-like formula for J valid for D greater-than-or-equal-to 5-6 ML. Numerical calculations for a simple tight-binding model of the spacer lead to J of the observed magnitude and to a long oscillation period. Calculations for Cr(100) with all five d bands included confirm the long period but an oscillation with a period of 2 ML is also found. This is in good agreement with the most recent experiments.