Light detection and ranging (LIDAR) technologies have been in spot light for some time due to its tremendous potential of enabling applications such as advanced driver assistance systems (ADAS), virtual reality (VR), and localization in wireless networks, etc. Single-photon avalanche diode (SPAD) is a very attractive choice as light detectors in LIDAR due to its high sensitivity. Meanwhile successful signal detection in SPAD needs to overcome issues such as noise due to background illuminance and detection reliability. In this paper, a SPAD-based LIDAR system is planned, a probabilistic model of light detection with SPAD is built, and a near Maximum Likelihood (ML) algorithm is developed to estimate the time-of-flight. Simulations using measured light-pulse power profiles demonstrate that the near ML approach outperforms popular range-finding algorithms. The probabilistic formulation also opens the door of developing machine-learning algorithms for LIDARs to operate in drastically varying environments.