The bomb was hidden in a roadside vending stall on Patani-Narathiwat road.
Insurgents detonated the bomb when a unit of eight rangers walked past in their patrol routine at 9 pm, police said.
The two injured rangers were identified as Ekkachai Phekhonnu and Khachornsak Ritdam.
They were slightly injured by bomb shrapnel.