Shot noise processes are omnipresent in physics and many of their properties have been extensively studied in the past, including the particular problem of level crossing of shot noise. Energy-sensitive, photon-counting detectors using comparators to discriminate pulse-heights are currently heavily investigated for medical applications,
e.g. for x-ray computed tomography and x-ray mammography. Surprisingly, no mention of the close relation between the two topics can be found in the literature on photon-counting detectors. In this paper, we point out the close analogy between level crossing of shot noise and the problem of determining count rates of photon- counting detectors subject to pulse pile-up. The latter is very relevant for obtaining precise forward models for photon-counting detectors operated under conditions of very high x-ray flux employed in clinical x-ray computed tomography. Although several attempts have been made to provide reasonably accurate, approximative models for the registered number of counts in x-ray detectors under conditions of high flux and arbitrary x-ray spectra, see, e.g., no exact, analytic solution is given in the literature for general continuous pulse shapes. In this paper we present such a solution for arbitrary response functions, x-ray spectra and continuous pulse shapes based on a result from the theory of level crossing. We briefly outline the theory of level crossing including the famous Rice theorem and translate from the language of level crossing to the language of photon-counting detection.