If the growing season is just about over and your tomato plants still have a crop of green tomatoes on them, don't rush to harvest them green and then let them ripen indoors. To encourage the green tomatoes on your vines to ripen before frost, remove any remaining flowers. The flowers won't have time to mature into fruits anyway and removing them will signal the plant to finish setting seed by ripening the existing tomatoes.
If frost threatens and the tomatoes are still a stubborn green, lift the whole plant and hang it in a dry spot in the garage or basement. The tomatoes should take the hint that their mother plant's days are numbered and begin to ripen (still on the vine).
I have this problem every year. I can't wait to try this at the end of summer to see if it really works!