The electric potential due to a single point electrode at the surface of a layered conducting medium is calculated by means of a linear combination of the potentials associated with a set of two-layer systems. This new representation is called the bilayer expansion for the Green's function. It enables the forward problem of resistivity sounding to be solved very efficiently, even for complicated profiles. Also, the bilayer expansion facilitates the solution of the resistivity inverse problem: the coefficients in the expansion are linearly related to apparent resistivity as it is measured and they are readily mapped into parameters for a model. Specifically, I consider models comprising uniformly conducting layers of equal thickness; for a given finite data set a quadratic program can be used to find the best-fitting model in this class for any specified thickness. As the thickness is reduced, models of this kind can approximate arbitrary profiles with unlimited accuracy. If there is a model that satisfies the data well, there are other models equally good or better whose variation takes place in an infinitesimally thin zone near the surface, below which there is a perfectly conducting region. This extraordinary class of solutions underscores the serious ambiguity in the interpretation of apparent resistivity data. It is evident that strong constraints from outside the electrical data set must be applied if reliable solutions are to be discovered. Previous work seems to have given a somewhat overly optimistic impression of the resolving abilities of this kind of data. I consider briefly a regularization technique designed to maximize the smoothness of models found with the bilayer inversion.