The yellow "be aware" alert is valid from 03:00 on Wednesday until 06:00 on Thursday.
The Met Office said the biggest threat of torrential downpours was likely to develop late on Wednesday afternoon.
It said that initial heavy rain and thunder was likely to be confined to parts of northern England before spreading to other areas.
The Scottish Environment Protection Agency has issued flood alerts for Dumfries and Galloway, the Borders and Edinburgh and the Lothians.
A Met Office weather warning for heavy rain and thunder has been issued for parts of southern and eastern Scotland.