Several physical quantities of interest are of quantum nature, often measurable as distinct particles. Light is one such example, photons being its particles. In conventional detectors, light is converted onto electrical charges and hence onto a current or a voltage, which is often digitized. Multiple conversions introduce errors and noise, which are generally impossible to eliminate and hard to reduce, in most cases. Alternatively, single photons can be recorded without intermediate conversions in a class of devices known collectively as single photon detectors. Among many methods to detect single photons, one based on avalanching is currently gaining considerable attention due to recent breakthroughs in CMOS integration and miniaturization. An example of this new technology is the Single Photon Avalanche Diode (SPAD), a type of photodiode biased at a voltage above breakdown, thus operating in so-called Geiger mode. This detector, the focus of this paper, is a low-cost solid-state device that can be mass-produced in submicron technologies with a high degree of repeatability across large arrays. SPADs exhibit a number of peculiar properties and can achieve unprecedented accuracy, thus enabling several scientific applications that require single photon resolution, picosecond timing accuracy, and/or very high dynamic range. SPADs are also interesting from an architectural point of view due to the digital and time-distributed nature of their output. Thus, on-chip systems can be envisaged whereby complex ad hoc algorithms, multiple uses, or reconfigurable computing are implemented with ideally no use of mixed-signal components. For this reason, several engineering disciplines will benefit from SPAD CMOS chips, such as computer vision, telecommunications, medical and bio-imaging, human-computer interfaces, entertainment systems, to name a few. In the paper we will also discuss CMOS SPADs and the architectural challenges posed by the quantum paradigm in integrated circuits. We introduce basic solid-state physics intuitions underlying CMOS SPADs and discuss several modeling issues. Finally, we present recent developments and future research directions, focusing on bio-imaging and high-performance computing.