We study theoretically how electrons, coherently injected at one point on the boundary of a two-dimensional electron system, are focused by a perpendicular magnetic field B onto another point on the boundary. Using the non-equilibrium Green's function approach, we calculate the generalized four-point Hall resistance R x y as a function of B. In weak fields, R x y shows the characteristic equidistant peaks observed in the experiment and explained by classical cyclotron motion along the boundary. In strong fields, R x y shows a single extended plateau reflecting the quantum Hall effect. In intermediate fields, we find superimposed upon the lower Hall plateaus anomalous oscillations, which are neither periodic in 1/B (quantum Hall effect) nor in B (classical cyclotron motion). The oscillations are explained by the interference between the occupied edge channels, which causes beatings in R x y . In the case of two occupied edge channels, these beatings constitute a new commensurability between the magnetic flux enclosed within the edge channels and the flux quantum. Introducing decoherence and a partially specular boundary shows that this new effect is quite robust.