Dual-comb ranging (DCR), with its superior overall performance compared to traditional ranging technologies, has recently attracted widespread interest in the research community. Nevertheless, the ranging distance or the material of the targets is limited by the detection sensitivity of optical asynchronous linear sampling. This limitation restricts the application of DCR in several highly significant scenarios. Here, we utilize the photon-counting method to dramatically break through the detection sensitivity to femtowatt. To overcome the impact of fiber-length wandering and achieve Michelson interference based absolute distance measurement, an orthogonal polarization interferometry-arm configuration and a reference-arm based photon-counting trigger protocol are proposed. This photon-counting DCR system can conduct long-period photon-counting coherently, thus, realizing the lowest detection power of phase-stabled DCR to date. The results show that with only 18 femtowatt average power detected, the time-of-flight and multi-wavelength interferometry yields a precision of 22 µm and 8 nm in 3 min, respectively. This work paves the way for the field of large-scale spacecraft formation flying, synthetic aperture space telescope position attitude control, interplanetary positioning, and hard target distance measurement.