Since the bands are quantized and calibrated, this is very straight forward for Landsat 8.
You will need a few band specific parameters from the scenes metadata. The scaling factors are standard so, once you have the band-specific values they can apply to any scene. However, this does not apply to the sun elevation, which is scene specific.
Mp = REFLECTANCE_MULT_BAND_x (band-specific multiplicative rescaling factor)
Ap = REFLECTANCE_ADD_BAND_x (band-specific additive rescaling factor)
SE = SUN_ELEVATION (sun elevation angle)
Then, at-sensor reflectance is just a matter of some simple raster algebra in the raster calculator.
( Mp * Qcal + Ap ) / sin(SE)
where; Qcal = digital numbers (DN) raster of band n