Bark at it and scare it away, if it were a mt lion or bear, at least bite its heels or try to interfere in some manner.
OTOH when our Cairn thought we had an intruder she barked her silly little head off and pushed my dad down the hall...
It depends on the breed, really.
As you know, I have Dobes, which are not scared dogs, by any definition.
*However*, I also have bears and packs of “coyotes” [eastern wolves, actually] on the mountains above and around me.
At night, when those beasts are wont to roam, the Dobes go out to the northwest corner of the yard, where my fence borders the ridge of the mountain, and *sniff* mightily, looking back at me, all the while.
They don’t run and play or even pace the fence in an agitated manner.
They just stand and sniff.
Why?
They’re not stupid and they know they have no chance against 500 pound bears or packs of wolves.
That’s not what they were created for, *at all*.
And honestly, I do not *want* them engaging such animals since you just *know* I’d have to jump into the fray and I’m not big enough or bad enough to take on such things.
Better that they simply let me know the danger is there and I can gun up and take care of it that way.