A fast method for ray tracing in high-frequency electromagnetic problems is proposed. The proposed method, which is based on adaptive space division using an octree structure, reduces the total CPU time needed to trace each ray while providing the same accuracy as conventional ray-tracing algorithms.