Apparatus and method for treating porous materials