We use principal component analysis (PCA) to estimate stellar masses, mean stellar ages, star formation histories (SFHs), dust extinctions and stellar velocity dispersions for a set of ∼290 000 galaxies with stellar masses greater than 1011 M⊙ and redshifts in the range 0.4 < z < 0.7 from the Baryon Oscillation Spectroscopic Survey (BOSS). We find that the fraction of galaxies with active star formation first declines with increasing stellar mass, but then flattens above a stellar mass of 1011.5 M⊙ at z∼ 0.6. This is in striking contrast to z∼ 0.1, where the fraction of galaxies with active star formation declines monotonically with stellar mass. At stellar masses of 1012 M⊙, therefore, the evolution in the fraction of star-forming galaxies from z∼ 0.6 to the present day reaches a factor of ∼10. When we stack the spectra of the most massive, star-forming galaxies at z∼ 0.6, we find that half of their [O iii] emission is produced by active galactic nuclei. The black holes in these galaxies are accreting on average at ∼0.01 the Eddington rate. To obtain these results, we use the stellar population synthesis models of Bruzual & Charlot to generate a library of model spectra with a broad range of SFHs, metallicities, dust extinctions and stellar velocity dispersions. The PCA is run on this library to identify its principal components over the rest-frame wavelength range 3700–5500 Å. We demonstrate that linear combinations of these components can recover information equivalent to traditional spectral indices such as the 4000-Å break strength and HδA, with greatly improved signal-to-noise ratio (S/N). In addition, the method is able to recover physical parameters such as stellar mass-to-light ratio, mean stellar age, velocity dispersion and dust extinction from the relatively low S/N BOSS spectra. We examine in detail the sensitivity of our stellar mass estimates to the input parameters in our model library, showing that almost all changes result in systematic differences in logM* of 0.1 dex or less. The biggest differences are obtained when using different population synthesis models – stellar masses derived using Maraston et al. models are systematically smaller by up to 0.12 dex at young ages.