We apply variational principles from statistical physics and the Landau theory of phase transitions to multicomponent alloys using the multiple-scattering theory of Korringa-Kohn-Rostoker (KKR) and the coherent potential approximation (CPA). This theory is a multicomponent generalization of the $S^{(2)}$ theory of binary alloys developed by G. M. Stocks, J. B. Staunton, D. D. Johnson and others. It is highly relevant to the chemical phase stability of high-entropy alloys as it predicts the kind and size of finite-temperature chemical fluctuations. In doing so it includes effects of rearranging charge and other electronics due to changing site occupancies. When chemical fluctuations grow without bound an absolute instability occurs and a second-order order-disorder phase transition may be inferred. The S$^{(2)}$ theory is predicated on the fluctuation-dissipation theorem; thus we derive the linear response of the CPA medium to perturbations in site-dependent chemical potentials in great detail. The theory lends itself to a natural interpretation in terms of competing effects: entropy driving disorder and favorable pair interactions driving atomic ordering. To further clarify interpretation we present results for representative ternary alloys CuAgAu, NiPdPt, RhPdAg, and CoNiCu within a frozen charge (or band-only) approximation. These results include the so-called Onsager mean field correction that extends the temperature range for which the theory is valid.