The incident occurred in Swinton at around 2pm on Friday, when it is reported that a red and black motorcycle with two men riding it pulled alongside a black BMW in Warren Vale.
The men are believed to have made abusive and racist comments towards the woman driving the BMW, before one of the men is reported to have shown the woman what appeared to be a small firearm.
The rear window of the BMW was then allegedly smashed by the two men before the motorcycle made off from the scene.
A South Yorkshire Police spokesman said: "The woman was not injured during the incident but has been left shaken. The incident is being treated as a hate crime.
"Police are making CCTV enquiries in the local community and are keen to hear from anyone who was in the area at the time."
Please call 101 or email [email protected] quoting incident number 561 of May 27, 2016.
You can also ask for information to be passed to PC2383 Holt in the Force Crime Unit.
You can ring Crimestoppers anonymously on 0800 555 111.