The transition from spherical to deformed shapes is studied in terms of large-scale shell-model calculations for Ba isotopes as a function of valence nucleon number with fixed single-particle space and Hamiltonian. A new version of the Monte Carlo shell model is introduced so as to incorporate pairing correlations efficiently, by utilizing condensed pair bases. The energy levels and electromagnetic matrix elements are described in agreement with experiments throughout the transitional region. The orbital M1 sum rule is calculated as a measure of the deformation evolution, and the Q-phonon picture is shown to be reasonable from spherical to deformed nuclei.