I find it hilarious that others are actually suggesting things like "do a refresh, it's Windows 8", or "Just use a keyfinder.".
Read the question the OP posted. The drive is CRASHED. Worst case scenario, it cannot even be read by another machine directly connected to SATA.
"Hey don't worry, just use the recovery disks!" - What is this, 2003? Most vendors (if not ALL by now) just shove your "restore disk" onto a separate partition on the hard drive [which, oh yeah, is dead now].
So, you can't use keyfinders cause the drive is toast, can't use recovery media because we've moved onto this streamlined 'it's on your hard drive' era, and a refresh is completely out of the question cause we obviously can't boot into Windows.
THE ACTUAL SOLUTION:
Get your hands on some clean installation media. If an official vendor will not give it to you, torrent it. We merely need to get Windows installed onto the machine with the NEW drive you have. The BIOS will at least tell us which version of Windows 8 it is. (If not, assume non-pro for consumer, and pro for business).
Click "skip" when the installer asks for the installation key when prompted. On the next screen, you'll hit CTRL + SHIFT + F3 to get to the "I'm an Admin, let me set up this computer for first time use" mode.
Download RWeverything (this reads the key out of the BIOS on Win8 Machines -- see this thread on how to use it) http://rweverything.com/download/ Then, hit the start button and open up Windows Activation (not the Win8 tile app, there should be a different one that shoots you back to the desktop). It will have an "activate" button. Click it and let it fail activation the first time. Then, it will ask if you want to try with a new key.
Insert key you found with RWeverything. Activate. SUCCESS.
You have to contact Sony support and order installation media, you can't just use any OEM disk. Support for OEM installations is usually handled by manufacturers themselves and, at least in my country, Microsoft support always redirects me to them.
Installing from another media might work, but may cause you update/licensing issues.
Of course if you have an installation DVD that came with your computer, go ahead and use it.
--EDIT--
Since Ramhound suggested that Windows 8.1 will accept any installation media with any key I've contacted Microsoft and, as I expected, they informed me that installing from different media will most likely not work. I am also planning to replace my HDD with an SSD, so I tried using OEM Windows 8.1 install DVD I bought earlier for a laptop on my computer that came with Windows 8.1 OEM, and it failed to install.
Bottom line is you got lucky, or you have install DVD from the same manufacturer, but generally this will not work most of the time.
Best Answer
This question is a little similar to something I have answered before. In my experience, if you have a computer with a COA sticker on the bottom, you can activate that key for the version of Windows that it's for on that computer as many times as you want. If you don't have a Windows installation disc for that specific version of windows, you can search the internet for an ISO image and burn a copy if you have to perform a clean install.
I always try to get an ISO file from a Windows source such as This first. If that for some reason doesn't work you can always try sources other than Microsoft such as This. If you try this link, please make sure to watch carefully when you are downloading. I had to create a quick and free account, and also there is a box that you need to uncheck that ask to download with a manager.
Just please read and look at all comments about the site you are downloading from. As a last resort you can also try to search a torrent site for a non activated copy. Make sure that it is a legal copy of Windows and does not say ANYTHING about pre-activated or cracked copy or anything similar. You want a copy that you have to activate.
After you have your ISO image file you can use a program such as Free ISO Burner to burn the image file to a DVD. The image file should already be bootable so you shouldn't have to mess with boot settings.
After you create your installation disc, you can then install windows. Use the COA key on the sticker to activate windows. When the install is finished you may still have to go into the activation wizard and complete a phone activation. The instructions to activate can be found here.
After you have everything activated and it shows that it is a genuine copy, you can then go to install updates. These will take forever, but you need to update.
That is pretty much it. I do not condone using illegal Keygens or hacks to activate windows so please make sure you try a Microsoft source first and make sure that it's a copy that you have to activate. The key is what makes the copy of Windows legal or illegal. You always want to have a good, safe, and legal installation of Windows.
PS. I just tried the method with downloading the ISO from the second source and tested it, and it works. The only other thing to note is that if you are using Free ISO Burner, make sure to check finalize disc. See below.