A two-dimensional analytical model is developed to describe transient grating formation for bipolar transport in photorefractive devices. This approach is suitable for structures in which the film thickness is comparable with or smaller than the grating vector. A crucial feature of the model is that it takes into account the edge effects by including both parallel and perpendicular components of the fields and the currents. The treatment is entirely general and valid for any geometry, in particular, for parallel (image amplifiers, etc) and for perpendicular (Pockels readout optical modulators, etc) photorefractive devices. The role of bulk and surface charges in each configuration is discussed. The results are illustrated in a few examples showing the effect the material and geometrical parameters have on the device resolution thus imposing more stringent limits upon the resolution than those found in previous studies.