a method for drilling a drainhole through a subsurface formation without intersecting upper or lower boundaries thereof in which a directionally sensitive measurement while drilling device carried on the drainhole string is used to measure a formation property which indicates proximity to a formation boundary . upon detection of such proximity , the direction of drainhole drilling is changed to direct the drainhole away from the detected boundary .