We describe the further development of phase refinement by iterative skeletonization (PRISM), a recently introduced phase-refinement strategy [Wilson & Agard (1993). Acta Cryst. A49, 97-104] which makes use of the information that proteins consist of connected linear chains of atoms. An initial electron-density map is generated with inaccurate phases derived from a partial structure or from isomorphous replacement. A linear connected skeleton is then constructed from the map using a modified version of Greer's algorithm [Greer (1985). Methods Enzymol. 115, 206-226] and a new map is created from the skeleton. This 'skeletonized' map is Fourier transformed to obtained new phases, which are combined with any starting-phase information and the experimental structure-factor amplitudes to produce a new map. The procedure is iterated until convergence is reached. In this paper significant improvements to the method are described as is a challenging molecular-replacement test case in which initial phases are calculated from a model containing only one third of the atoms of the intact protein. Application of the skeletonization procedure yields an easily interpretable map. In contrast, application of solvent flattening does not significantly improve the starting map. The iterative skeletonization procedure performs well in the presence of random noise and missing data, but requires Fourier data to at least 3.0 A. The constraints of linearity and connectedness prove strong enough to restore not only missing phase information, but also missing amplitudes. This enables the use of a powerful statistical test, analogous to the 'free R factor' of conventional refinement [Brünger (1992). Nature (London), 355, 472-474], for optimizing the performance of the skeletonization procedure. In the accompanying paper, we describe the application of the method to the solution of the structure of the protease inhibitor ecotin bound to trypsin and to a single isomorphous replacement problem.