The 'best way' is to take a chauffeured limo with champagne flowing but you're not really looking for the 'best way', I'm guessing. You're looking for a way that "isn't too expensive and doesn't take too long".
Unfortunately, getting from Anaheim to any beach via public transit is time-consuming. The local bus system OCTA.NET has a 'travel planner' that will tell you the route(s) you need to take if you provide starting and ending points and day/time of transfer. (Google maps provides a similar feature).
The closest beach to Anaheim is Huntington Beach. A weekday transfer from your hotel to the Huntington Beach Pier area is about 4 hours return, requiring 2 or 3 buses in succession. If you hired a car, the drive would be about 35 minutes, each way. A taxi would take the same amount of time but would cost $60 each way.
If it's possible, I would recommend transferring to Los Angeles from Anaheim (lots of ways to do this) and stay 'on the beach' or near it, in the L.A. area. This will be a lot easier and less expensive and you'll be 20 minutes or less from LAX on your last night.
Thanks for the reply HopSkipJump - the limo sounds like a great option, but as you guessed a bit out of the price range, unless the lottery win happens ! Suspected public transit was a bit of long shot for us.
Will be moving on to a hotel near the ocean after the Anaheim, but was just trying to work out what to do on our 'spare day' if we take a break from the Disneyland experience.
Actually the somewhat faster option is Newport Beah (Balboa Peninsula), take OCTA Route 43 South to Newport Beah and transfer to Route 79, which will take you to the Balboa Pier.
Maybe 3 hours or so, instead of the somewhat longer trip to Huntington Beach.
Plenty of other options, check out the Top Questions on the right side of the screen, there are two topics that talk about easy trips using public transit (Either shopping or attractions).
If all you want to see is ocean but have no car, why not take Darkbeer's suggestion and take the 43 bus to Costa Mesa and then the 79 bus which will take you straight to the Balboa Pier area. Newport Beach, the city, is there too. Or for further exploration, take the 79 bus to Balboa, get off at the Pacific Coast Highway stop, and take the OCTA route #1 north to Long Beach, or if you're more adventurous, South to Dana Point. The 1's route will go by the side of the ocean for most of its journey, so if you want to see water, it's the most scenic public bus route the Orange County Transit Authority system has. The bus route northward will pass by Huntington Beach, and Bolsa Chica beach amongst others before ending its run in Long Beach's VA memorial hospital; the southward trip will go by the nice beach communities of laguna beach and Dana point , amongst other places, before ending its journey at the San Clemente bus stop, not very far from one of the entrances to the famed Camp Pendleton US Marine Corps base.
Conversely, if you wanna take your ocean travel further, you can catch a bus into the Amtrak station adjacent to Angel Stadium, book a seat on the Pacific Surfliner train heading south to San Diego, and enjoy the ride that way. I'd choose the city bus options though. Sure it's more time consuming, but it beats spending a lot of money for something like a limo if all you want to do is have some fun, fun, fun at the beach for a day.
Keep in mind just renting a car for the day. That would allow you flexability to come and go as you please and visit areas. Its such as easy drive from Anaheim to Huntington Beach, its all on surface streets and takes about 30 min.
Theres some shopping there and smaller restaurants, as well as a Pier to walk out on and Rubys Diner at the end of the Pier to eat at ( not the greatest food, but fun atmosphere) Sandwiches are good though. Usually people fishing off the pier, and usually surfers near the Pier to watch.
However, since you are already visiting the ocean after Anaheim, you may just want to look through the list of things to do in Anaheim which may give you more options that are closer.
You could even take a Metrolink commuter train to Oceanside (www.metrolinktrains.com), which would cost less than Amtrak, but what you could do there without a car I'm not sure. Renting a car sounds best.
If you want to use the train (Amtrak/Metrolink), the San Clemente Pier station is right on the beach and the best option. But not all trains stop at the station, so check the schedules.
Since you are already going to be staying at a beach after Anaheim, how about hopping on the Metro 460 from Disneyland and making the quick trip to the other nearby theme park, Knott's Berry Farm?
Or take a train ride to south Orange County and explore the Mission San Juan Capistrano, one of the old Spanish missions of early California.
But if you want to see a few of beaches of Orange County in one day, look into the OC Beach Tour.
When will you be here, by the way?