A sarcastic phrase and reference to a Bible tale of a prostitute being sentenced to being stoned to death where Jesus says, "let he who has never sinned, cast the first stone"
It is now commonly used as a way of saying someone has no room to judge you for an act, specifically if they have done it themselves.
A: (smoking a cigar) I cannot belive you started smoking, it is terrible for you and shameful
B: (in a sarcastic tone) Well cast the first stone.