We proposed an algorithm for modeling the average (monochromatic) light attenuation coefficient and predicting the euphotic zone in shallow waters. Our algorithm uses Kalman filter and Kalman smoother to preprocess experimental data and utilizes Expectation-Maximization (EM) to estimate the average attenuation coefficient. The latter is then fitted to an appropriate function which is employed to predict the location of the euphotic zone and can be employed to solve various inverse problems of interest. In our implementation of the EM algorithm which is iterative, we indicate how to select the initial values of relevant parameters. We demonstrated the algorithm on clear water, turbid water and water with suspended chlorophyll. Our algorithm has applications in the monitoring of water quality, marine environment health, fishery and image correction. Besides, in these applications, our algorithm is capable of handling in situ data in near real time.