given the options, i'd go for ruby ... mostly because it is such an extremely beautiful, powerful, expressive, consistent and radical language ... you can get a very good introduction here ... plus ruby-on-rails and merb (which are united in rails 3) are very productive environements/frameworks to develop apps ... i personally don't know anything which is so suited for fast developement of server driven applications ... also ruby is very good for scripting ...
there are many things i dislike about PHP and Java, but let's not get into details ... my main accusations would be, that Java is quite verbose and bloated, and the most used frameworks even more so ... and PHP has a terrible API design and quite a lot of semantical inconsistencies, even some syntactical, although most of the latter are getting resolved recently ... plus, it is not very fast ... and also, you get many downvotes on stackoverflow, when you critisize one of the languages ... :D
however, a reason to use Java is the massive ammount of tools available (allthough only a part of them is relevant for the web) ... when it comes to PHP, the best thing is deployment ... it's very easy to get PHP running on a server ... and most servers have PHP anyway ... so if you want to write software, that can run on many servers, PHP is the best choice ... if you decide to use it, do yourself a favor, and use it only with a proper framework/environment, as Flow3, Zend, synfony, codeigniter or CakePHP ... PHP makes it easy to hack together some code (i'd even dare to say it was kind of designed for that) ... but you'll quickly regret that you relied on that ...
the microsoft stack was already mentioned as a possible alternative ... up to you to decide ... it's good, but expensive (licenses make scaling much more expensive) ... and IIS has relatively much downtime compared to other servers ...
personally, i'd suggest you use haXe ... a very nice and expressive language, that allows you to compile to
- AVM1 or AVM2 bytecode (virtual machines for flash player 6-8 and 9-10)
- neko bytecode (neko is a very fast and lightweight virtual machine, suitable for writing web servers, daemons or desktop apps)
- JavaScript source code
- ActionScript 3 source code
- PHP source code
- C++ source code (using neash, you can use flash player API with C++, most notably the display/graphics API, which is very easy to use)
- Java source code for android (currently prealpha, but demo looks good) ...
you use a single language to
- write servers (be it HTTP or TCP)
- create rich clients (be it javascript or flash)
- target smartphones (either flash smart phones or iPhone through C++ (well, still not optimal, but progress is being made) and, in near future, Android ...
- build desktop apps
on top of that haXe is an open source community driven language ... plus of course haXe has a very consistent OO API design and provides many cool languages features, such as high order functions, parametrized enums, generics, and structural subtyping ... and if you decide to use it, be sure to check out haxelib for helpful frameworks/libraries ... ;)