While there are leash laws about dogs in Illinois, there may come a time when you are approached by a dog who is off leash and unattended. This can be a scary experience because you never know a strange dog's demeanor. Often the dog will be super friendly and all fear will disperse, but in some cases, the dog may be cagey or even aggressive. It is important to know what to do in these cases to prevent any injuries and get away from the dog safely.
USA Dog Behavior notes there is no one exact thing you should do when a strange dog approaches you. You really need to assess the situation and react accordingly. If the dog is strolling towards you and not running or moving quickly, you can often just turn and walk away. The dog will likely lose interest and go elsewhere. If the dog is aggressively moving towards you, your best option is to put a physical barrier between you, such as a fence, a garbage can or something large that will get between you and the dog.
If the dog is barking or growling, it may just be scared, so you can try turning towards the dog so your body is facing it. This might intimidate the dog and cause it to run away. Another option is to carry treats with you that you can toss away so you can seek safety. You may also try repellant spray, but that usually only works if the dog gets very close to you. This information is for education and is not intended as legal advice.