Son of a Bitch (SOB), and Son of a Gun, two variants, both euphemisms. There are varios theories regarding the origins of the phrase, however one can believe what they like. Can be put as an interjection expressing;
1. (When discovering a friend of yours screwing with your grandmother, mother, sister, cousin, girlfriend...)
She; "Someones commin in!"
Friend; "I am baby...(realises it ain't a joke)what?really? who the..."
You;(mouth wide open)"...what?...Son of a bitch!"
2. (When you see a Nerd, getting it on with 5 very fine chicks at a party...)
Travis; "Dude...what the fuck?...you see that?"
Jason; "Holy shit..."
Both; "I'll be damned...son of a bitch..."
3. (When a silly little fucker, plays around with your balls, and a fight begins)
Opponent; "i'm goin to kick your arse!"
You; "we'll see about that, you silly son of a bitch!"
4. (When your girlfriend dumps you, cause your shit in bed)
Jack; "...hey man...don't worry..millions of other bitches in the sea...thats life!"
You; (crying your eyes out)...lifes a son of a bitch Jack"
5. (When you discover a friend of yours fucking a dog)
Dog; (trying to escape with all his strengh)...HEEELP! Get this fucker off me!"
Your girlfriend; "OH MY GOD!"
You; "...filthy son of a bitch!"
6. (Whilst taking a crap on your nieghbours front lawn, for pissing you off for some reason one evening)
Niehgbour; "What the hell do you think your doing?"
You; "What's it look like you son of a bitch?"
7. (When some friend of yours buys you a blowup sex doll for your birthday)
Tom; "here, hope you like it"
You; "aaaawww, you didn't have to, you son of a bitch"
8. Or for any other situation.