In section 1 the statistical thermodynamic treatment of ion exchange has been developed for a system in which there is one kind of exchange site (for example, sodalite or felspar). In an earlier treatment (Barrer & Falconer 1956) it was assumed that when two entering ions occupied adjacent sites an extra energy could arise which was not present when these ions did not occupy nearest neighbour positions. It was also assumed that despite this pair-wise additive extra energy the distribution of ions on sites was random. This latter assumption has now been removed, the consequences of its removal examined, and the resultant treatment applied to calculation of characteristic isotherm contours, thermodynamic equilibrium, free energy function for the mixed crystals, miscibility gaps between end members of the exchange and the influence of temperature and other factors upon such gaps. The treatment can represent and explain many of the features established experimentally in exchanges involving zeolites, felspars, felspathoids and clay minerals, especially when it is extended, as has been done in section 2, to allow for situations in which there is more than one kind of exchange site, a situation which is common among zeolites. After considering the general case of n different site groups in the exchanger and deriving expressions for the chemical potentials and equilibrium constants in terms of contributions from component site groups, calculations have been made in section 2 of representative isotherm contours for the particular situations: (i) Two site groups, each fully exchangeable by ion A and ion B. (ii) Two site groups, one excluding ion A and the other excluding ion B. (iii) Two site groups, one available for both A and B and the other only for B. For the first situation the occurrence of miscibility gaps has also been investigated. In section 3 the theory has been extended to isomorphous replacements of the types Na, Al $\rightleftarrows $ Si and Ca, Al $\rightleftarrows $ Na, Si in tectosilicate frameworks. Certain tectosilicates have nearly fixed Al/Si ratios while in others these ratios may vary within wide limits. In addition it is found experimentally that in tectosilicates Al/Si ratios do not exceed unity. The treatment developed can satisfy these three characteristics. The free energy function plotted against Al content exhibits a minimum the position, depth and sharpness of which depend upon the values of certain constants which have a clear physical meaning. The compositions of some zeolites and felspathic minerals have been interpreted in terms of the free energy function.