      SUBROUTINE RAYFAC(NODE,IFAC)
C
      INCLUDE 'com_coor.f'
C
      DIMENSION NODE(27),IPERM(9,6)
      REAL*4 XXX(9),YYY(9),ZZZ(9)
      DATA IPERM/
     5           21 ,  1 ,  4 ,  3 ,  2 , 12 , 11 , 10 ,  9  
     2,          22 ,  2 ,  3 ,  7 ,  6 , 10 , 19 , 14 , 18  
     6,          23 ,  8 ,  5 ,  6 ,  7 , 16 , 13 , 14 , 15
     1,          24 ,  5 ,  8 ,  4 ,  1 , 16 , 20 , 12 , 17  
     3,          25 ,  5 ,  1 ,  2 ,  6 , 17 ,  9 , 18 , 13  
     4,          26 ,  4 ,  8 ,  7 ,  3 , 20 , 15 , 19 , 11 /
C
      DO I=1,9
        II = NODE(IPERM(I,IFAC))
        XXX(I) = X(II)
        YYY(I) = Y(II)
        ZZZ(I) = Z(II)
      ENDDO
C
      N = NODE(20+IFAC)
      CALL RAY(N,9,XXX,YYY,ZZZ,RR1,XCCOR,YCCOR,ZC,0)
      RR2 = RR1
      CALL RAY(N,9,XXX,YYY,ZZZ,RR2,XCCOR,YCCOR,ZC,1)
      DO I=1,9
        II = NODE(IPERM(I,IFAC))
cc        RAYON1(II) = RAYON1(II)+RR1
        RAYON2(II) = RAYON2(II)+RR2
        IF (ICOR(II).EQ.0) ICOR(II)=1
        ICOR(II) = ICOR(II)+1
      ENDDO
      END
