The words rail, rale sound the same but have different meanings and spellings. Why do rail, rale sound the same even though they are completely different words?
The answer is simple: rail, rale are homophones of the English language.
A bar extending horizontally between supports, as in a fence.
A structure made of such bars and supports and forming a barrier or guard; a railing.
A steel bar used, usually in pairs, as a track for railroad cars or other wheeled vehicles.
The railroad as a means of transportation: goods transported by rail.
An abnormal respiratory sound characterized by fine crackles.
Definitions from The American Heritage® Dictionary of the English Language, 4th Edition and Wordnik.
Homophones (literally "same sound") are usually defined as words that share the same pronunciation, regardless of how they are spelled.
If they are spelled the same then they are also homographs (and homonyms); if they are spelled differently then they are also heterographs (literally "different writing").