Fitting spectra using MCMC