The horizontal spreading of thermal and chemical deposits in a porous medium