Get a surveyor
If there is water in the bilge, it is undoubtedly from the rain, and you need to figure out how its getting inside the boat. This could be a minor problem (coming in the companionway hatch, or a major issue. If the water has been getting in through the deck for years, you could have some significant rot/delamination in the deck. Unless this is a daysailer with a price of less than about $3000, I would recommend you have the boat professionally surveyed. I did so for my Oday 23. I was told by a few that the boat was too small and the price too low to justify spending a couple of hundred bucks on the survey, but I think it was so worth it. The surveyor spent over an hour poking his head into places I didn't know about, found some insignificant deck delamination, and also pointed out to me several things that were in his mind really positive aspects of the boat's condition that I hadn't considered. After the survey, he even gave me a break on his usual rates because of the boat's size and simplicity. Even if you know a lot about boats (and I thought I did before the survey), it helps to have an unbiased opinion. It can also help in your negotiations on price for the boat.