Net Operating Losses (NOLs) in one year can offset taxes owed in future years. It works for personal taxes too if it's a "casualty" loss.