Probability theory is applied to the analysis of fMRI data. The posterior distribution of the parameters is shown to incorporate all the information available from the data, the hypotheses, and the prior information. Under appropriate simplifying conditions, the theory reduces to the standard statistical test, including the general linear model. The theory is particularly suited to handle the spatial variations in the noise present in fMRI, allowing the comparison of activated voxels that have different, and unknown, noise. The theory also explicitly includes prior information, which is shown to be critical in the attainment of reliable activation maps.