The four-year-old was travelling on a bus on Berwick Drive, Dundee, when two boys were spotted throwing stones at the vehicle.
Police condemned the boys' "reckless" behaviour, which they said could endanger lives.
The incident happened shortly before 8pm on Tuesday.
The boys are thought to be 12 or 13 years old and were wearing green-coloured hooded tops and light-coloured tracksuit bottoms.
The girl was taken to Ninewells Hospital in the city as a precaution but suffered only a minor injury.
A Police Scotland spokesman said: "The implications of throwing any type of missile at a moving vehicle are very serious indeed, not least when it is public transport carrying passengers.
"Those who get involved in this reckless behaviour may view it as a bit of harmless fun, but they should consider the potential consequences of their actions. Their actions threaten lives."
Anyone with information is asked to call police on 101 or Crimestoppers on 0800 555 111.