The reason it says Recovery HD is locked is because you are pointing the OS X installer at Recovery HD instead of the "Mac HD/Macintosh HD" option. IF that option or something similar is not there that means you need to complete an Erase and Reinstall(Format and Reinstall, Simply clicking Reinstall OS X will do an archive install) because the OS partition is most likely damaged and therefore will not appear as a bootable drive for the OS X Installer.
This will involve total data loss barring any type of data recovery tools/actions you wish to take prior to..
Link for Erase and Reinstall Mavericks -
https://support.apple.com/kb/PH14243?locale=en_US
If you need more details with the steps involved you can also look at this -...