In the red
From the practise of using red ink to denote debt or losses on financial balance sheets. Likewise, in the black for businesses that are financially solvent.
This phrase conjures up images of inky-fingered clerks in Dickensian offices scratching in ledgers with quill pens. In fact, the term is much more recent than that. The first known citation of it is in the 1926 Wise-crack dictionary, by George H. Maines and Bruce Grant:
"In the red, losing money in show parlance."
The phrase wasn't restricted to show (theatre) language and there's no evidence to show that it originated in the theatre. The following year it was used in the April edition of Scribner's Magazine:
"We've got to put forth our best efforts from now till the end of the month, or we'll be in red on the books," he announced.