Police launched a manhunt after a man armed with a weapon tried to rob Coopers Jewellery in Barnstaple on Thursday afternoon.
Owner David Bruce said he "cracked the man on the wrist" with the bat when a gun was pointed at him.
Nothing was stolen from the shop and the police are continuing to investigate.
Four firearms units, a dog handler and local officers were among police looking for the man after reports of a robbery.
Mr Bruce said the man "came marching straight in and slapped a big fat bag on the counter and asked me to fill it".
"I told him you picked the wrong guy, he thought I was going to the safe but I got my baseball bat.
"He pointed the gun at me and I instinctively cracked him on the wrist with the baseball bat and the gun fired."
Mr Bruce was not injured by the shot and said he then hit the man again twice with "real force behind the blows" before chasing him out of his shop.
He said the man "was caught totally unawares" and added: "I come from a school of hard knocks. I wasn't scared."
The raider was described as short and wearing a sandy or khaki coloured long trench coat.
Mr Bruce said he had a full latex mask on with a scarf and sunglasses and "looked weird, like a cyborg with sunglasses".
Devon and Cornwall Police said they believed the would-be robber's "weapon was some kind of blank firing firearm" and "certainly don't think there's any risk to the public from the weapon he had".
A jeweller has said he "chased" an armed robber out of his shop with a baseball bat.