A detailed analysis of the focusing and collimation of x-rays by microchannel plates (MCPs) is presented. The focusing effect derives from external reflection of grazing-incidence rays at the interior surfaces of the hollow channels of the MCP, and is similar to optical focusing by a thin lens. The point spread function of an MCP is given, taking into account surface roughness and misaligned channels. The calculations based on multiply reflected rays and skew rays, and is valid for a spherically curved MCP of any thickness. The surface roughness calculation utilises a vector perturbation theory for surface scattering, which expresses the angular distribution of scattered radiation, and consequently the point spread function, as a sum of a specularly reflected component and a diffusely reflected component. For comparison with experimental results the effects due to a finite source and a detector aperture are also evaluated. 30 refs., 15 figs.