I don't want to worry you – as I'm sure that your frame is only dented – but if it was cracked, and made a creaking noise as the sides of the crack rubbed slightly, spraying lube on the area will make the sound go away but the crack will still be there. This is the same reason why creaks tend to stop when you ride in the wet – the water acts as a lubricant and stops the creaking noise.
If you want to check the frame, give the bike a wash by hand, and as you clean it, pay careful attention to the BB area, and maybe turn it upside down as you wash it and check underneath too. If there is a crack, you should spot it.