There's no line unless you already know the line.
I make cancer jokes to people online, or race (even though race jokes aren't that funny, more of a middle-school thing). But, i'd never make on to my friend tyler whose mom died of cancer, just because i know where the line already is.
just depends on the situation, i guess.