I think the rectifier tube on my B-52 AT212 is on it's way out. I turned it on today and played for a few minutes, then heard what sounded like a tube or something just dying, followed by some high pitched horrible noises.

Turning it back on got it to work for a bit, but the sound came back and then the amp played at an extremely low volume. I got frustrated and gave it a wack (stupid, I know) and it started to work fine. Eventually it came back a but later.

Looking behind the amp showed one tube sparking on the inside and looking generally non functioning (ha!). I took it out and discovered it as a 5AR4 rectifier tube.

Can I just go by another one and replace it or may it have died for a different reason? The amp's not 100% dead, just makes the noise occasionally and I have to turn it off and on again to get it to stop.

What shall I do? I have very limited experience with tube amps, ha! Thanks!
My Random Gear:

-Epiphone Dot
-Epiphone `57 Les Paul Jr. Reissue
-Epiphone AJ-200 Acoustic
-Fender Hot Rod Deluxe
-DS-1 Distortion
You can try replacing the preamp as is but just know that there may be more damage to the amp than meets the eye. When I hear the term 'sparking' I'm thinking one of the pins arced and that can cause damage to the circuit board itself. As long as you don't touch anything on the inside you can pull the chassis out and look inside for damage (scarring basically).

Otherwise, I'd take it to a tech for look over, but don't get suckered into a bunch of repairs you don't need.

PS: www.dougstubes.com
Hmmm, shoot. Is there any other way to tel besides looking for this damage? Like I said, the amp still works. And the tube isn't constantly "sparking", but at one point it was.
My Random Gear:

-Epiphone Dot
-Epiphone `57 Les Paul Jr. Reissue
-Epiphone AJ-200 Acoustic
-Fender Hot Rod Deluxe
-DS-1 Distortion
If there was sparking then there was a good chance there was arcing. This happened to my Valveking. I didn't see sparks but the amp got super crackly and preamp tube got very bright. I swapped the tube out and luckily everything went back to normal. So sure, try changing out the preamp tube first.
I would imagine that if the rectifier tube went, the worst that would happen is you'd have half-wave rectification or no power at all to the rest of the amplifier.

Replace it and see if it's still acting up.
Everyone is entitled to an opinion.

Feel free to express yours so I can make an informed judgement about how stupid you are.
Sparking (we call that arcing) is never a good sign. Replace it. You just plug a new one in. No adjustments needed, just plug and play.
Gilchrist custom
Yamaha SBG500
Randall RM100 & RM20
Marshall JTM45 clone
Marshall JCM900 4102 (modded)
Marshall 18W clone
Fender 5F1 Champ clone
Atomic Amplifire
Marshall 1960A
Boss GT-100

Cathbard Amplification
My band