In this paper, we propose a Bayesian approach to estimate the curve of a function f(·) that models the solar power generated at k moments per day for n days and to forecast the curve for the (n+1)th day by using the history of recorded values. We assume that f(·) is an unknown function and adopt a Bayesian model with a Gaussian-process prior on the vector of values f(t)=f(1),…, f(k). An advantage of this approach is that we may estimate the curves of f(·) and fn+1(·) as "smooth functions" obtained by interpolating between the points generated from a k-variate normal distribution with appropriate mean vector and covariance matrix. Since the joint posterior distribution for the parameters of interest does not have a known mathematical form, we describe how to implement a Gibbs sampling algorithm to obtain estimates for the parameters. The good performance of the proposed approach is illustrated using two simulation studies and an application to a real dataset. As performance measures, we calculate the absolute percentage error, the mean absolute percentage error (MAPE), and the root-mean-square error (RMSE). In all simulated cases and in the application to real-world data, the MAPE and RMSE values were all near 0, indicating the very good performance of the proposed approach.