Phase retrieval is a nonlinear technique used to recover the phase in the Fourier domain using intensity measurements at the image plane and additional constraints. We describe a method to solve the phase retrieval problem using linear iterations near the solution, which provides both analytical insight into phase retrieval and numerical results. The algorithm finds the maximum a posteriori estimate of the phase using prior information about the statistics of the noise and the phase, and it was found to converge well in practice. When phase retrieval is performed on data from subdivided apertures, there is a loss of information regarding the relative piston terms of the subapertures. This error is quantified. We find that there is a smaller wavefront error when estimating the phase from a full aperture rather than from a subdivided aperture. Using a combination of intensity measurements from full and subdivided apertures results in a small improvement at very high photon levels only.