He clashed with a group of young people on Almswall Road in Kilwinning, police said.
The boy was taken to Crosshouse Hospital in Kilmarnock for treatment and has since been released.
Police say the attack took place at 9.45pm on Friday.
CCTV images from the area are being reviewed by officers and door to door enquiries are being carried out.
Police would like to speak with three young men aged around 16 and 17-years-old who are understood to have been in the area at the time.
One was wearing a white hooded top, another had a red tracksuit, a black body warmer and a blue baseball cap while the third teenager was wearing a red, white and blue tracksuit top.
Detective Sergeant John Deans said: "A young boy has suffered a head injury in an unprovoked attack so if you were in the area at the time or you have any knowledge of the suspect or the crime, please do get in touch with us."
Police are asking anyone with information to contact them on 101 or call Crimestoppers on 0800 555 111.