A new method is presented for the analysis of data recorded with a Ring Imaging Cherenkov (RICH) counter. The method, an iterative sorting of hits on the photon detector, is particularly useful for events where rings overlap considerably. The algorithm was tested on simulated data for the HERA-B experiment. (C) 1999 Elsevier Science B.V. All rights reserved.