The assault took place at North High Street, Musselburgh, between 19:15 and 19:40 on Saturday.
The victims were taken to Edinburgh Royal Infirmary, where they were treated for minor injuries.
Police Scotland described the attack as "vicious" and appealed to anyone who may have information about the incident to come forward.
The injured men are described as being white and about 35 years old.
One man was of medium build, 5ft 9in tall with short brown hair. He was wearing a dark blue and white top with grey trousers.
The second man was 5ft 8in tall and was wearing a black top.
There is no description of their attacker.
Two men were taken to hospital after a substance was sprayed in their faces next to a cash machine in East Lothian.