According to the DTN (Delay Tolerant Network, DTN), traditional routing protocols do not consider the properties of encounter between the node, and a modified algorithm of Spray and Focus is proposed based on these and the quality degree of node. The algorithm includes two stages: based on quality degree of node Spray stage and wait stage. In the first stage, algorithm according to the attribute value to determine the quality degree of the node, select the relay node based on it and send a message to the relay node which has the higher quality degree. The simulation results show that, the algorithm can improve the message delivery rate and reduce the network resource consumption.