We have performed in-situ x-ray diffraction (XRD) measurements in order to acquire the information about synthesis conditions of several rare-earth transition-metal pnictides. By considering the results for a battery of the in-situ XRD measurements, we have obtained conditions optimal for synthesizing layered rare-earth zinc phosphides RZn3P3 (R = Y and Dy) and a new filled skutterudite compound TbxCo4Sb12. According to the optimum condition acquired by the in-situ XRD experiments, we have succeeded in synthesizing high-quality samples.