States across the country are struggling with billions of dollars in budget gaps. Now many of them are looking at ways to raise revenue by expanding some form of gambling. Massachusetts is considering a bill that would license two resort-style casinos and bring slot machines to four of the state’s racetracks.