It really depends on the 'type' of rock it is. By this I mean whether it's impermeable or permeable. Impermeable rocks don't allow water through and permeable rocks do. It has to do with how 'porous' a rock is: how many openings it has and how spaced apart are its particles are. Sandstone is permeable and Shale impermeable.