Bastion is a strong offensive character with the ability to quickly kill any opposing hero. Being easy for any player to get to grips with he is a popular choice for those seeking an easy Introduction to Overwatch.
Bastions main weakness is the tendency for him to be stationary most of the time so it's possible to use good team work to take care of a troublesome Bastion enemy with any Characters, but some have some distinct advantages to countering his attacks.
Using the grenades you can fire at Bastions position from behind cover with no danger to yourself. Bastion will have to move or die. The RIP-Tyre ultimate is also a clear winner.
With the long range of her sniper she can cover peek from a distance where bastions fire is less effective and take him out with a few shots.
A well aimed primary fire will damage and attract Bastions attention followed up with Genjis reflect ability to bounce back the subsequent volley of fire will take out Bastion pretty quickly.
The best way to use Pharah in this fight is to hide and peek around corners to fire off rockets while ducking back into cover to avoid getting killed. If Bastion doesn't move then a small number of rockets will take him out.
Again using a peek fire strategy with the alt fire option here Symmetra will be able to take out Bastion as long as she avoids taking to many hits. The orbs will travel though enemy shielding so it will be effective even if Bastion has help.
In most cases McCree is underpowered but at close range with the flashbang and fan the hammer combo readied up he should stand a good chance of winning that fight.
It's possible to use the Defence matrix to shield your advance and get close to Bastion and then the self destruct to force bastion to move and become more vulnerable.
If you have the pulse bomb to hand this will turn the fight in your favour. If not then you are better off using your speed to escape and wait for backup.
Use the hook to pull Bastion out of the turret mode to make him more vulnerable. This opens him up for you an others to attack.
Generally a sitting duck for Bastion, but shadow step ability can allow you to get behind and if yo are quick or bastion is distracted with other enemies you can win.
You could try with another Bastion. But in general its the stationary Bastion set up for the fight that will win so you would need the enemy to come find you.