Ab initio plane-wave pseudopotential calculations of electronic and vibrational properties have been carried out for the ternary phosphides BaM2P2 (M = Ni, Rh and Ir) with a ThCr2Si2-type structure. The calculated electronic results show the metallic character of BaM2P2, and the plots of total and partial density of states of BaM2P2 exhibit strong hybridization between the d states of the M atom and the p states of the P atom below the Fermi energy. Differences in the phonon spectrum and density of states both in the acoustical and optical ranges for these compounds are presented and discussed. The Eliashberg spectral function for these compounds has been calculated by using a linear response approach based on the density functional theory. By integrating the Eliashberg spectral function, the average electron-phonon coupling parameter (lambda) is determined to be 0.61 for BaNi2P2, 0.55 for BaIr2P2, and 0.43 for BaRh2P2. Using the calculated values of lambda and the logarithmically averaged phonon frequency omega(ln) the superconducting critical temperature (T-c) values for BaNi2P2, BaIr2P2, and BaRh2P2 are obtained to be 2.80, 1.97, and 0.70 K, respectively, which compare very well with their experimental values of 3.0, 2.1, and 1.0 K.