Modeling the transmission of beta rays through thin foils in planar geometry