We present the results of band structure calculations for ACr2X4 (A=Zn, Cd, Hg and X=O, S, Se) spinels. Effective exchange coupling constants between Cr spins are determined by fitting the energy of spin spirals to a classical Heisenberg model. The calculations reproduce the change of the sign of the dominant nearest-neighbor exchange interaction J1 from antiferromagnetic in oxides to ferromagnetic in sulfides and selenides. It is verified that the ferromagnetic contribution to J1 is due to indirect hopping between Cr t2g and eg states via X p states. Antiferromagnetic coupling between 3-rd Cr neighbors is found to be important in all the ACr2X4 spinels studied, whereas other interactions are much weaker. The results are compared to predictions based on the Goodenough-Kanamori rules of superexchange.