This paper is devoted to the statistical approach to matched-field processing (MFP). In Sec. I, a statistical model of the Green's function of a random oceanic waveguide is described using the mean field and the second moment. In Sec. 2, using Bayesian approach, optimum target detection and localization algorithms matched to a deterministic and a stochastic ocean are derived. First, the optimum decisive statistic (log-likelihood ratio) is derived for a deterministic ocean. In the general case, ocean parameter fluctuations make the Green's function random and so we need to average the log-likelihood ratio. The MFP algorithms for a random ocean waveguide developed on the basis of the Bayesian approach are less precise than the algorithms for a deterministic oceanic waveguide model, but they are more robust. In Sec. 3 a comparative analysis of the proposed MFP methods and the known suboptimum MFP techniques is carried out. The ambiguity surfaces for the proposed algorithms, Bartlett, Minimum Variance (MV), MV with neighboring location constraints, and MV with sound-speed perturbation constraints methods are presented. The proposed MFP method outperformed other algorithms under random ocean conditions, giving the least bias error and the lowest sidelobes.